/* =========================================
   REGISTRO.CSS - Vista de Crear Cuenta
   ========================================= */

/* ─── Layout base ─── */
.register-body {
    background: var(--bg-main);
}

.register-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: calc(68px + 2rem) 5% 3rem;
    min-height: 100vh;
}

.register-container {
    background: #fff;
    width: 100%;
    max-width: 1160px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    overflow: hidden;
    align-items: stretch;
}

/* ─── Columna Formulario ─── */
.register-form-section {
    padding: 3rem 3.5rem;
    background: #fff;
    overflow-y: auto;
}

.form-header {
    margin-bottom: 1.75rem;
}

.form-header h1 {
    font-size: 1.85rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Selector de Rol ─── */
.role-selector {
    display: flex;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    padding: 5px;
    gap: 4px;
    margin-bottom: 2rem;
    border: 1.5px solid var(--border);
}

.role-selector input[type="radio"] { display: none; }

.role-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.role-selector input[type="radio"]:checked + .role-option {
    background: #fff;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ─── Fieldset Secciones ─── */
.form-section {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.25rem;
    background: #fdfdfc;
}

.form-section legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    padding: 0 0.5rem;
    background: #fdfdfc;
    border-radius: 4px;
}

.form-section legend svg {
    color: var(--primary);
    flex-shrink: 0;
}

.section-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* ─── Grid de Formulario ─── */
.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid.col-1 {
    grid-template-columns: 1fr;
}

.col-span-2 {
    grid-column: span 2;
}

/* ─── Input Groups ─── */
.input-group {
    display: flex;
    flex-direction: column;
}

.register-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    color: var(--text-dark);
    letter-spacing: 0.01em;
}

.required {
    color: #e05c5c;
    margin-left: 2px;
}

.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"],
.register-form input[type="date"],
.register-form input[type="tel"],
.register-form input[type="number"],
.register-form select,
.register-form textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-main);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-dark);
    transition: var(--transition);
    line-height: 1.4;
}

.register-form select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a9488' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    appearance: none;
}

.register-form textarea {
    resize: vertical;
    min-height: 100px;
}

.register-form input:focus,
.register-form select:focus,
.register-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(61, 155, 122, 0.1);
}

.register-form input::placeholder,
.register-form textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* ─── Input con prefijo ─── */
.input-with-prefix {
    display: flex;
    align-items: stretch;
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    overflow: hidden;
    transition: var(--transition);
}

.input-with-prefix:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(61, 155, 122, 0.1);
}

.input-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(61, 155, 122, 0.06);
    border-right: 1px solid rgba(61, 155, 122, 0.12);
    white-space: nowrap;
}

.input-with-prefix input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ─── Input con toggle password ─── */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    padding-right: 44px !important;
}

.toggle-password {
    position: absolute;
    right: 11px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.toggle-password svg { width: 17px; height: 17px; }
.toggle-password:hover { color: var(--text-dark); }

/* ─── Hint y error ─── */
.input-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: block;
    line-height: 1.45;
}

/* ─── Indicador de fuerza de contraseña ─── */
.password-strength {
    height: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.35rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    width: fit-content;
}

.strength-1 { background: rgba(220, 80, 80, 0.12); color: #c0392b; }
.strength-2 { background: rgba(230, 150, 50, 0.12); color: #d67d00; }
.strength-3 { background: rgba(240, 200, 80, 0.15); color: #8a7000; }
.strength-4 { background: rgba(61, 155, 122, 0.12); color: var(--primary-dark); }

/* ─── Rango de costo ─── */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.range-separator {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

/* ─── Radio Cards (modalidad) ─── */
.radio-card-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.radio-card {
    cursor: pointer;
}

.radio-card input[type="radio"] { display: none; }

.radio-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 1rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    transition: var(--transition);
    color: var(--text-body);
}

.radio-card-inner svg { color: var(--text-muted); }

.radio-card-inner strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-dark);
    display: block;
}

.radio-card-inner span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.radio-card input[type="radio"]:checked + .radio-card-inner {
    border-color: var(--primary);
    background: rgba(61, 155, 122, 0.06);
    box-shadow: 0 0 0 3px rgba(61, 155, 122, 0.1);
}

.radio-card input[type="radio"]:checked + .radio-card-inner svg { color: var(--primary); }

/* ─── Checkbox Tags (enfoques, áreas) ─── */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.check-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-body);
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-main);
    user-select: none;
}

.check-tag input[type="checkbox"] { display: none; }

.check-tag:hover {
    border-color: rgba(61, 155, 122, 0.4);
    color: var(--text-dark);
}

.check-tag:has(input:checked) {
    background: rgba(61, 155, 122, 0.1);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

/* Fallback para navegadores sin :has() */
.check-tag input[type="checkbox"]:checked ~ * {
    color: var(--primary-dark);
}

/* ─── Términos y condiciones ─── */
.terms-section {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-body);
    line-height: 1.5;
    user-select: none;
}

.checkbox-label input[type="checkbox"] { display: none; }

.checkmark {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid rgba(61, 155, 122, 0.4);
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    transition: var(--transition);
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 8px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

.checkbox-label a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ─── Aviso psicólogo ─── */
.psi-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(240, 200, 122, 0.12);
    border: 1.5px solid rgba(240, 200, 122, 0.4);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
}

.psi-notice svg {
    color: var(--accent-dark);
    flex-shrink: 0;
    margin-top: 2px;
}

.psi-notice p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-body);
}

/* ─── Botón full ─── */
.btn-full { width: 100%; justify-content: center; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }

/* ─── Footer ─── */
.form-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a { font-weight: 600; color: var(--primary); }
.form-footer a:hover { color: var(--primary-dark); }

/* ─── Columna Branding ─── */
.register-branding {
    background: linear-gradient(160deg, #1c2e28 0%, #2d4a3e 55%, #3d6b55 100%);
    padding: 3.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: sticky;
    top: 68px;
    height: calc(100vh - 68px);
    overflow-y: auto;
}

.branding-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(61, 155, 122, 0.2);
    color: var(--primary-light);
    border: 1px solid rgba(61, 155, 122, 0.3);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 1.75rem;
    width: fit-content;
}

.register-branding h2 {
    font-size: 2rem;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 0.85rem;
}

.register-branding h2 em {
    font-style: italic;
    color: var(--primary-light);
}

.register-branding > p {
    font-size: 0.9rem;
    color: rgba(232, 240, 236, 0.75);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.branding-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.feature-set {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.feature-item strong {
    display: block;
    font-size: 0.875rem;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    margin-bottom: 2px;
}

.feature-item span {
    font-size: 0.8rem;
    color: rgba(232, 240, 236, 0.65);
    line-height: 1.4;
}

.branding-testimonial {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
}

.branding-testimonial p {
    font-size: 0.875rem;
    color: rgba(232, 240, 236, 0.9);
    line-height: 1.55;
    font-style: italic;
    margin-bottom: 1rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.testimonial-author strong {
    display: block;
    font-size: 0.82rem;
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
}

.testimonial-author span {
    font-size: 0.76rem;
    color: rgba(232, 240, 236, 0.6);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .register-container {
        grid-template-columns: 1fr 0.85fr;
    }
}

@media (max-width: 860px) {
    .register-container {
        grid-template-columns: 1fr;
    }

    .register-branding {
        display: none;
    }

    .register-form-section {
        padding: 2.5rem 2rem;
    }
}

@media (max-width: 600px) {
    .register-wrapper {
        padding: calc(68px + 1rem) 0 0;
        align-items: flex-start;
    }

    .register-container {
        border-radius: 0;
        box-shadow: none;
        min-height: calc(100vh - 68px);
    }

    .register-form-section {
        padding: 2rem 1.25rem;
    }

    .form-grid.col-2 {
        grid-template-columns: 1fr;
    }

    .col-span-2 {
        grid-column: span 1;
    }

    .radio-card-group {
        grid-template-columns: 1fr;
    }
}
