/* ==================== RESET Y BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #003D82;
    --primary: #0056b3;
    --primary-light: #4A90D9;
    --accent: #00A3E0;
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 450px;
    width: 100%;
    overflow: hidden;
}

/* ==================== HEADER ==================== */
.header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 1.5rem 2rem;
    text-align: center;
}

.header .logo-img {
    max-width: 280px;  /* Más grande */
    max-height: 100px;  /* Más alto */
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
    object-fit: contain;
    background: white;
    padding: 1rem 2rem;  /* Más padding */
    border-radius: 12px;  /* Bordes más redondeados */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);  /* Sombra suave */
}

.header .subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* ==================== CONTENIDO ==================== */
.content {
    padding: 2rem;
}

.content h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    text-align: center;
}

.content p {
    color: var(--gray-600);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ==================== FORMULARIO ==================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.form-group input::placeholder {
    letter-spacing: normal;
    color: var(--gray-400);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

/* ==================== CAJA DE CONTRASEÑA ==================== */
.password-box {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.password-box .label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.password-box .password {
    color: var(--white);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    display: inline-block;
    margin-top: 0.5rem;
}

/* ==================== BOTÓN COPIAR CONTRASEÑA ==================== */
.btn-copy {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy.copied {
    background: var(--success);
    border-color: var(--success);
}

/* ==================== SECCIÓN EMAIL ==================== */
.email-section {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.email-section h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.email-option:hover {
    border-color: var(--primary-light);
    background: var(--white);
}

.email-option.selected {
    border-color: var(--primary);
    background: rgba(0, 86, 179, 0.05);
}

.email-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.email-option .email-text {
    flex: 1;
}

.email-option .email-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.email-option .email-value {
    font-size: 0.95rem;
    color: var(--gray-800);
    font-weight: 500;
}

.new-email-input {
    display: none;
    margin-top: 0.75rem;
}

.new-email-input.visible {
    display: block;
}

.new-email-input input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    text-align: left;
    letter-spacing: normal;
}

.new-email-input input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ==================== ALERTAS ==================== */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-error {
    background: var(--danger-light);
    color: #991B1B;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
}

.alert-info {
    background: rgba(0, 163, 224, 0.1);
    color: var(--primary-dark);
}

.alert i {
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert div {
    flex: 1;
}

/* ==================== ESTADOS ==================== */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* ==================== LOADING ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== FOOTER ==================== */
.footer {
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.footer p {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin: 0;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    body {
        padding: 0;
        align-items: flex-start;
    }
    
    .container {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .header {
        padding: 1.5rem;
    }
    
    .header .logo-img {
        max-width: 240px;
        max-height: 85px;
        padding: 0.75rem 1.5rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .password-box .password {
        font-size: 1.5rem;
        letter-spacing: 2px;
    }
}