/* =============================================================
   Fundación Hogar Jimena — Login stylesheet
   Paleta: coral (corazón), azul profundo (confianza), crema cálida
============================================================= */

:root {
    --fhj-coral:        #E63946;
    --fhj-coral-soft:   #EF476F;
    --fhj-coral-light:  #FFD6DB;
    --fhj-blue-deep:    #1D3557;
    --fhj-blue:         #457B9D;
    --fhj-blue-soft:    #A8DADC;
    --fhj-cream:        #F1FAEE;
    --fhj-white:        #FFFFFF;
    --fhj-gray-100:     #F7F8FA;
    --fhj-gray-200:     #E9ECEF;
    --fhj-gray-400:     #ADB5BD;
    --fhj-gray-600:     #495057;
    --fhj-gray-800:     #212529;
    --fhj-shadow:       0 20px 60px rgba(29, 53, 87, 0.15);
    --fhj-shadow-sm:    0 4px 12px rgba(29, 53, 87, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--fhj-gray-800);
    background: var(--fhj-cream);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.login-container {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

/* ---------- Left branding panel ---------- */
.brand-panel {
    position: relative;
    background: linear-gradient(135deg, #1D3557 0%, #457B9D 55%, #E63946 120%);
    color: var(--fhj-white);
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.brand-panel::before,
.brand-panel::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.brand-panel::before {
    width: 480px; height: 480px;
    top: -160px; right: -160px;
}

.brand-panel::after {
    width: 320px; height: 320px;
    bottom: -120px; left: -80px;
    background: rgba(230, 57, 70, 0.15);
}

.brand-top {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    z-index: 2;
}

.brand-logo {
    width: clamp(80px, 16vw, 120px);  /* escala entre 80 y 120px según el viewport */
    height: clamp(80px, 16vw, 120px);
    aspect-ratio: 1 / 1;              /* mantiene cuadrado aunque width/height difieran */
    border-radius: 24px;
    background: rgba(255,255,255,0.14);
    padding: 10px;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
}

.brand-name {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.brand-name span {
    display: block;
    font-weight: 400;
    font-size: 0.82rem;
    opacity: 0.85;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.brand-hero {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.brand-hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}

.brand-hero h1 em {
    font-style: normal;
    color: var(--fhj-coral-light);
    position: relative;
}

.brand-hero p {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.92;
    margin-bottom: 2rem;
}

.brand-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.value-item {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
}

.value-item svg {
    width: 28px; height: 28px;
    margin-bottom: 0.5rem;
    color: var(--fhj-coral-light);
}

.value-item strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.value-item span {
    font-size: 0.72rem;
    opacity: 0.85;
}

.brand-footer {
    position: relative;
    z-index: 2;
    font-size: 0.78rem;
    opacity: 0.75;
}

/* ---------- Floating hearts ---------- */
.floating-heart {
    position: absolute;
    color: rgba(255, 255, 255, 0.10);
    pointer-events: none;
    animation: float 8s ease-in-out infinite;
    z-index: 1;
}

.floating-heart:nth-child(1) { top: 18%;  left: 10%; animation-delay: 0s;   font-size: 28px; }
.floating-heart:nth-child(2) { top: 42%;  right: 12%; animation-delay: 2s;  font-size: 40px; color: rgba(230,57,70,0.20); }
.floating-heart:nth-child(3) { bottom: 28%; left: 22%; animation-delay: 4s; font-size: 22px; }
.floating-heart:nth-child(4) { top: 65%;  left: 55%; animation-delay: 1s;   font-size: 18px; color: rgba(230,57,70,0.18); }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50%      { transform: translateY(-18px) rotate(5deg); }
}

/* ---------- Right form panel ---------- */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: var(--fhj-white);
}

.login-card {
    width: 100%;
    max-width: 420px;
}

.login-card .welcome {
    margin-bottom: 2rem;
}

.login-card .welcome h2 {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--fhj-blue-deep);
    margin-bottom: 0.4rem;
    letter-spacing: -0.3px;
}

.login-card .welcome p {
    color: var(--fhj-gray-600);
    font-size: 0.95rem;
}

/* Alert */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert svg {
    flex-shrink: 0;
    width: 18px; height: 18px;
    margin-top: 1px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Form */
.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fhj-gray-800);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

/* Solo el ícono izquierdo (hijo directo), NO el SVG del botón ojo */
.input-wrapper > svg {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--fhj-gray-400);
    pointer-events: none;
    transition: color 0.2s;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--fhj-gray-800);
    background: var(--fhj-gray-100);
    border: 2px solid transparent;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.form-control::placeholder { color: var(--fhj-gray-400); }

.form-control:focus {
    outline: none;
    background: var(--fhj-white);
    border-color: var(--fhj-blue);
    box-shadow: 0 0 0 4px rgba(69, 123, 157, 0.12);
}

/* Solo el ícono izquierdo cambia de color al hacer focus */
.form-control:focus + svg,
.input-wrapper:focus-within > svg {
    color: var(--fhj-blue);
}

/* "Mostrar contraseña" — checkbox simple debajo del campo.
   Sin posicionamiento absoluto: el área clickeable es toda la fila
   (checkbox + texto), imposible que se desalinee. */
.show-password {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
    font-size: 0.85rem;
    color: var(--fhj-gray-600);
    cursor: pointer;
    user-select: none;
    width: fit-content;
}
.show-password input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--fhj-blue);
    flex-shrink: 0;
}
.show-password:hover { color: var(--fhj-blue); }

/* Form options row */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fhj-gray-600);
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    width: 16px; height: 16px;
    accent-color: var(--fhj-coral);
    cursor: pointer;
}

.forgot-link {
    color: var(--fhj-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover { color: var(--fhj-coral); }

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 0.95rem;
    font-size: 0.98rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--fhj-white);
    background: linear-gradient(135deg, var(--fhj-coral) 0%, var(--fhj-coral-soft) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 20px rgba(230, 57, 70, 0.28);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(230, 57, 70, 0.38);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit svg {
    width: 18px; height: 18px;
    transition: transform 0.25s;
}

.btn-submit:hover svg { transform: translateX(3px); }

/* Divider */
.divider {
    margin: 2rem 0 1.25rem;
    text-align: center;
    position: relative;
    color: var(--fhj-gray-400);
    font-size: 0.82rem;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0; right: 0;
    height: 1px;
    background: var(--fhj-gray-200);
    z-index: 1;
}

.divider span {
    position: relative;
    z-index: 2;
    background: var(--fhj-white);
    padding: 0 1rem;
}

.login-footer {
    text-align: center;
    font-size: 0.82rem;
    color: var(--fhj-gray-400);
    margin-top: 1.5rem;
}

/* Mobile brand (only visible on small screens) */
.mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 2rem;
}

.mobile-brand img {
    width: clamp(88px, 28vw, 130px);   /* escala con el ancho de pantalla */
    height: clamp(88px, 28vw, 130px);
    aspect-ratio: 1 / 1;
    border-radius: 24px;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: var(--fhj-shadow-sm);
    margin-bottom: 1rem;
}

.mobile-brand h3 {
    color: var(--fhj-blue-deep);
    font-size: 1.1rem;
    font-weight: 800;
}

.mobile-brand span {
    color: var(--fhj-gray-400);
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ---------- Register-specific ---------- */
.register-card {
    max-width: 480px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem;
}

.form-row .form-group {
    margin-bottom: 1.15rem;
}

.required {
    color: var(--fhj-coral);
    font-weight: 700;
    margin-left: 2px;
}

.terms-row {
    margin-bottom: 1.25rem;
}

.terms-row .remember-me {
    align-items: flex-start;
    font-size: 0.82rem;
    line-height: 1.4;
}

.terms-row .remember-me input {
    margin-top: 2px;
}

.btn-secondary {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fhj-blue);
    background: var(--fhj-gray-100);
    border: 2px solid var(--fhj-gray-200);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    color: var(--fhj-coral);
    border-color: var(--fhj-coral-light);
    background: #FFF5F6;
    transform: translateY(-1px);
}

.login-footer-note {
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--fhj-gray-400);
    line-height: 1.5;
}

/* ---------- Success box (after register) ---------- */
.success-box {
    text-align: center;
    padding: 1rem 0;
}

.success-box h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--fhj-blue-deep);
    margin: 1rem 0 0.6rem;
    letter-spacing: -0.3px;
}

.success-box p {
    color: var(--fhj-gray-600);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 0.5rem;
}

.success-box .success-hint {
    font-size: 0.85rem;
    color: var(--fhj-gray-400);
    margin-bottom: 1.5rem;
}

.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #86EFAC 0%, #22C55E 100%);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.3);
    animation: pop 0.4s ease-out;
}

.success-icon svg { width: 36px; height: 36px; }

@keyframes pop {
    0%   { transform: scale(0.6); opacity: 0; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

/* ---------- Activate page ---------- */
.activate-wrap {
    min-height: 100vh;
    background: linear-gradient(135deg, #F1FAEE 0%, #E9F2F5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.activate-card {
    width: 100%;
    max-width: 520px;
    background: var(--fhj-white);
    border-radius: 20px;
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--fhj-shadow);
    text-align: center;
}

.activate-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.activate-brand img {
    width: clamp(48px, 14vw, 64px);
    height: clamp(48px, 14vw, 64px);
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    object-fit: contain;
    flex-shrink: 0;
    box-shadow: var(--fhj-shadow-sm);
}

.activate-brand h3 {
    color: var(--fhj-blue-deep);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: left;
}

.activate-brand span {
    display: block;
    color: var(--fhj-gray-400);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 2px;
    text-align: left;
}

.activate-card h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--fhj-blue-deep);
    margin: 1rem 0 0.6rem;
}

.activate-card p {
    color: var(--fhj-gray-600);
    font-size: 0.95rem;
    line-height: 1.55;
}

.activate-card a {
    color: var(--fhj-blue);
    text-decoration: none;
}
.activate-card a:hover { color: var(--fhj-coral); }

.activate-footer {
    margin-top: 2rem;
    font-size: 0.78rem;
    color: var(--fhj-gray-400);
}

.error-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #FCA5A5 0%, #DC2626 100%);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
    animation: pop 0.4s ease-out;
}

.error-icon svg { width: 36px; height: 36px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .login-container { grid-template-columns: 1fr; }
    .brand-panel     { display: none; }
    .mobile-brand    { display: block; }
    .form-panel      { padding: 2.5rem 1.5rem; }
}

@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .activate-brand { flex-direction: column; gap: 0.5rem; }
    .activate-brand h3, .activate-brand span { text-align: center; }
}

@media (max-width: 480px) {
    .login-card .welcome h2 { font-size: 1.5rem; }
    .brand-hero h1 { font-size: 2rem; }
    .mobile-brand img { border-radius: 18px; }
    .activate-brand { gap: 0.65rem; }
}

@media (max-width: 360px) {
    /* Teléfonos muy pequeños — reducir logo mobile aún más */
    .mobile-brand img { border-radius: 14px; }
    .form-panel { padding: 2rem 1rem; }
}

/* ---------- Pie de atribución (Desarrollado por Magasoft.tech) ---------- */
/* Mismo estilo tipográfico que .login-footer-note para coherencia visual. */
.powered-by {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: var(--fhj-gray-400);
    line-height: 1.5;
    font-weight: 400;
}
.powered-by a {
    color: var(--fhj-blue);
    text-decoration: none;
    transition: color 0.2s ease;
}
.powered-by a:hover {
    color: var(--fhj-coral);
}
.powered-by a strong {
    font-weight: 400;   /* sin énfasis extra, iguala al resto del texto */
}

/* Variant para la pantalla de login (panel izquierdo) — blanco sobre gradiente */
.brand-panel .powered-by {
    color: rgba(255, 255, 255, 0.65);
}
.brand-panel .powered-by a {
    color: rgba(255, 255, 255, 0.95);
}
.brand-panel .powered-by a:hover {
    color: var(--fhj-coral-light);
}
