/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0c2a44;
    --secondary-color: #1976d2;
    --accent-color: #42a5f5;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --background-light: #f8f9fa;
    --background-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: url('/img/fundo.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    margin-bottom: 2rem;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    animation: pulse 2s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Main Container */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.welcome-section {
    width: 100%;
    max-width: 440px;
}

.welcome-content {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    padding: 2rem 2rem 3rem 2rem;
    box-shadow: var(--shadow-heavy);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.welcome-header {
    margin-bottom: 2rem;
}

.welcome-logo {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.welcome-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Code Form */
.code-form {
    margin-bottom: 1rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--background-light);
    border-radius: var(--border-radius-small);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.input-icon {
    padding: 0 1rem;
    color: var(--text-light);
    font-size: 1.2rem;
}

.input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-light);
}

.submit-btn {
    background: var(--secondary-color);
    border: none;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.submit-btn:hover {
    background: var(--primary-color);
    transform: translateX(-2px);
}

.submit-btn:active {
    transform: translateX(0);
}

.submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* Desktop: boto dentro do input-group */
@media (min-width: 769px) {
    .input-group {
        margin-bottom: 0;
    }
    
    .desktop-btn {
        display: block;
        margin-top: 0;
        border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0;
    }
    
    .mobile-btn {
        display: none;
    }
}

/* Mobile: boto separado */
@media (max-width: 768px) {
    .desktop-btn {
        display: none;
    }
    
    .mobile-btn {
        display: block;
    }
}

.error-message {
    background: #ffebee;
    color: var(--error-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-small);
    margin-top: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid var(--error-color);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1.5rem 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.footer-link:hover {
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
}

.modal-content.closing {
    animation: modalSlideOut 0.3s ease-in forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--background-light);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

/* Selection Options */
.selection-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.option-card {
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: var(--secondary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.option-card.selected {
    border-color: var(--secondary-color);
    background: rgba(25, 118, 210, 0.05);
}

.option-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-card.disabled:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.option-card.disabled .option-icon {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
}

.option-card.disabled h4 {
    color: var(--text-secondary);
    opacity: 0.6;
}

.option-card.disabled p {
    color: rgba(255, 255, 255, 0.5);
}

.option-icon {
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 2rem;
}

.option-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.option-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.option-badge {
    background: var(--accent-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.option-badge.installed {
    background: var(--success-color);
}

.option-badge.not-installed {
    background: var(--warning-color);
}

.option-badge.disabled {
    background: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

/* iOS Instructions */
.ios-modal .modal-content {
    max-width: 500px;
}

.ios-instructions {
    margin-bottom: 2rem;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: var(--border-radius-small);
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.step-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ios-actions {
    text-align: center;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--background-light);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 0 1rem;
    }
    
    .logo-section {
        gap: 0.75rem;
    }
    
    .header-logo {
        width: 40px;
        height: 40px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text p {
        font-size: 0.8rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .welcome-section {
        max-width: 100%;
    }
    
    .welcome-content {
        padding: 1.5rem 1rem 2rem 1rem;
        min-height: 480px;
    }
    
    .welcome-logo {
        width: 100px;
        height: 100px;
        margin: 0 auto 1rem;
    }
    
    .welcome-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .input-group {
        flex-direction: row;
        border-radius: var(--border-radius);
        margin-bottom: 1rem;
    }
    
    .input-icon {
        padding: 0 1rem;
    }
    
    .input-group input {
        padding: 0.75rem 0;
        /*text-align: center;*/
    }
    
    .submit-btn {
        border-radius: var(--border-radius);
        width: 100%;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .modal {
        padding: 0.5rem;
    }
    
    .modal-content {
        margin: 0;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .selection-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .option-card {
        padding: 1.5rem;
    }
    
    .option-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .option-card h4 {
        font-size: 1.1rem;
    }
    
    .instruction-step {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .step-number {
        width: 25px;
        height: 25px;
        font-size: 0.8rem;
    }
    
    .step-content h4 {
        font-size: 1rem;
    }
    
    .step-content p {
        font-size: 0.85rem;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .welcome-section {
        max-width: 500px;
    }
    
    .welcome-content {
        padding: 2.5rem 2rem 3rem 2rem;
        min-height: 520px;
    }
    
    .welcome-logo {
        width: 120px;
        height: 120px;
        margin: 0 auto 1.25rem;
    }
    
    .welcome-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .welcome-subtitle {
        font-size: 1.05rem;
        margin-bottom: 2.25rem;
    }
}

@media (max-width: 480px) {
    .welcome-content {
        padding: 1rem 0.75rem 1.5rem 0.75rem;
        min-height: 420px;
    }
    
    .welcome-logo {
        width: 80px;
        height: 80px;
        margin: 0 auto 0.75rem;
    }
    
    .welcome-title {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .welcome-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1rem;
    }
    
    .input-group input {
        font-size: 1rem;
    }
    
    .submit-btn {
        margin-top: 0.5rem;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .option-card {
        padding: 1rem;
    }
    
    .option-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .welcome-content {
        padding: 3rem 2.5rem 4rem 2.5rem;
        min-height: 600px;
    }
    
    .welcome-logo {
        width: 150px;
        height: 150px;
        margin: 0 auto 2rem;
    }
    
    .welcome-title {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1.2rem;
        margin-bottom: 3rem;
    }
    
    .selection-options {
        gap: 2rem;
    }
    
    .option-card {
        padding: 2.5rem;
    }
    
    .option-icon {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #cccccc;
        --text-light: #999999;
        --background-white: #1a1a1a;
        --background-light: #2a2a2a;
        --border-color: #404040;
    }
    
    .header {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
    }
    
    .footer {
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(20px);
    }
    
    .welcome-content {
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(5px);
    }
}

/* Print styles */
@media print {
    .loading-screen,
    .modal {
        display: none !important;
    }
    
    .main-container {
        display: block !important;
    }
    
    body {
        background: white !important;
    }
}