:root {
    --color-pino: #12502a;
    --color-verde: #2f7d2d;
    --color-colina: #8cc23a;
    --color-lima: #a6d13c;
    --color-gold: #d9a521;
    --color-gold-light: #f0c648;
    --color-maroon: #4a1c1f;
    --color-crema: #f7ebc2;
    --color-crema-soft: #fdf6dc;
    --bg-card: rgba(18, 80, 42, 0.78);
    --card-border: rgba(240, 198, 72, 0.38);
    --text-main: #ffffff;
    --text-muted: #e6efc6;
    --input-bg: rgba(253, 246, 220, 0.95);
    --input-border-focus: #f0c648;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', -apple-system, sans-serif; 
}

body {
    min-height: 100vh;
    background: 
        radial-gradient(circle 420px at 75% 25%, rgba(240, 198, 72, 0.38), transparent 70%),
        linear-gradient(180deg, #12502a 0%, #226b27 45%, #2f7d2d 75%, #5a9e29 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Efecto de niebla matutina entre las montañas */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse 90% 45% at 50% 65%, rgba(255, 255, 255, 0.08), transparent 75%);
    pointer-events: none;
    z-index: 2;
}

/* Silueta de cordilleras idéntica a la página principal */
.mountain-backdrop {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 52vh;
    pointer-events: none;
    z-index: 1;
}

.mountain-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.mountain-layer svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Contenedor del río de montaña realista */
.river-viewport {
    position: fixed;
    bottom: -2px;
    left: 0;
    right: 0;
    width: 100%;
    height: 48vh;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.river-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Reflejos vivos del agua con ondulación suave */
.river-shimmer {
    opacity: 0.65;
    mix-blend-mode: overlay;
    animation: waterGleam 4s ease-in-out infinite alternate;
}

.river-foam {
    opacity: 0.7;
    animation: foamDrift 5s ease-in-out infinite alternate;
}

@keyframes waterGleam {
    0%   { opacity: 0.45; transform: scaleY(0.98); }
    50%  { opacity: 0.85; transform: scaleY(1.02); }
    100% { opacity: 0.55; transform: scaleY(1); }
}

@keyframes foamDrift {
    0%   { transform: translateX(-4px); }
    100% { transform: translateX(6px); }
}

/* Partículas sutiles de luz ambiental */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: #fdf6dc;
    opacity: 0.35;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0%   { transform: translateY(105vh) scale(0); opacity: 0; }
    20%  { opacity: 0.65; }
    80%  { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1.15); opacity: 0; }
}

/* Tarjeta de login en cristal Monte Andino */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 425px;
    margin: 1.5rem;
    background: var(--bg-card);
    border: 1.5px solid var(--card-border);
    border-radius: 22px;
    padding: 2.3rem 2.2rem;
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    box-shadow:
        0 25px 65px rgba(10, 40, 18, 0.65),
        0 0 35px rgba(217, 165, 33, 0.22),
        0 1px 0 rgba(255, 255, 255, 0.2) inset;
    animation: cardEntrance 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes cardEntrance {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Marca y logotipo */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
    text-align: center;
}

.brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: #ffffff;
    border: 2px solid var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    margin-bottom: 0.2rem;
    position: relative;
    overflow: hidden;
}

.brand-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.brand-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.brand-ribbon {
    display: inline-block;
    background: rgba(217, 165, 33, 0.18);
    color: var(--color-gold-light);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 0.26rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(240, 198, 72, 0.45);
    text-transform: none;
}

.form-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 1.35rem;
    text-align: center;
    text-transform: none;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-crema);
    margin-bottom: 0.45rem;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    pointer-events: none;
    display: flex;
}

.input-icon svg { 
    width: 17px; 
    height: 17px; 
}

.form-control {
    width: 100%;
    padding: 0.82rem 1rem 0.82rem 2.65rem;
    background: var(--input-bg);
    border: 1.5px solid transparent;
    border-radius: 10px;
    color: #111827;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    outline: none;
}

.form-control::placeholder { 
    color: #6b7280; 
    font-size: 0.88rem; 
}

.form-control:focus {
    border-color: var(--input-border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3.5px rgba(240, 198, 72, 0.32);
}

/* Botón para mostrar u ocultar contraseña */
.btn-toggle-pass {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color 0.2s;
}

.btn-toggle-pass:hover { 
    color: #111827; 
}
.btn-toggle-pass svg { 
    width: 18px; 
    height: 18px; 
}

/* Mensajes de error */
.error-box {
    background: rgba(74, 28, 31, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.6);
    color: #fee2e2;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

/* Botón principal de login (mismo dorado de la web con texto vino legible) */
.btn-login {
    width: 100%;
    padding: 0.92rem;
    background: linear-gradient(180deg, var(--color-gold-light), var(--color-gold));
    color: var(--color-maroon);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(217, 165, 33, 0.45);
    letter-spacing: 0.01em;
}

.btn-login:hover { 
    filter: brightness(1.04); 
    box-shadow: 0 10px 30px rgba(217, 165, 33, 0.6); 
    transform: translateY(-1px);
}
.btn-login:active { 
    transform: scale(0.98); 
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    width: 18px; 
    height: 18px;
    border: 2.5px solid rgba(74, 28, 31, 0.35);
    border-top-color: var(--color-maroon);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* Pie de tarjeta */
.card-footer {
    margin-top: 1.6rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.card-footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
}

.card-footer a:hover { 
    color: var(--color-gold-light); 
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 198, 72, 0.3), transparent);
    margin: 1.35rem 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { 
        animation-duration: 0.001ms !important; 
    }
}