:root {
    --color-primary: #2e7d32;
    --color-primary-dark: #1b5e20;
    --color-accent: #4caf50;
    --color-gold: #c9a227;
    --color-gold-light: #e8cf7d;
    --color-maroon: #6e1f1f;
    --bg: #0b1a0d;
    --card-bg: rgba(255,255,255,0.06);
    --card-border: rgba(255,255,255,0.1);
    --text: #f3f4f6;
    --text-muted: rgba(243,244,246,0.55);
    --input-bg: rgba(255,255,255,0.07);
    --input-border: rgba(255,255,255,0.15);
    --input-border-focus: var(--color-accent);
    --error-bg: rgba(211,47,47,0.15);
    --error-border: rgba(211,47,47,0.4);
    --error-text: #ff8a80;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    min-height: 100vh;
    background-color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Fondo dinámico sutil con los colores corporativos configurados */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% -10%, var(--color-primary), transparent 60%),
        radial-gradient(ellipse 60% 50% at 90% 110%, var(--color-accent), transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, var(--color-primary-dark), transparent 60%);
    opacity: 0.35;
    animation: bgPulse 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes bgPulse {
    from { opacity: 0.25; }
    to   { opacity: 0.45; }
}

/* Silueta de fondo SVG */
.mountain-bg {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    width: 100%; height: 45vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}

/* Partículas flotantes */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.3;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0%   { transform: translateY(110vh) scale(0); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* Card principal */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 2.25rem;
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow:
        0 30px 60px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.04) inset,
        0 1px 0 rgba(255,255,255,0.1) inset;
    animation: cardIn 0.5s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Logo / Marca */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
    text-align: center;
}

.brand-icon {
    width: 68px; height: 68px;
    border-radius: 18px;
    background: var(--color-primary);
    border: 2px solid rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    margin-bottom: 0.25rem;
    position: relative;
    overflow: hidden;
}

.brand-icon img {
    width: 44px; height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
    position: relative; z-index: 1;
}

.brand-icon-fallback {
    font-size: 1.8rem; font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    position: relative; z-index: 1;
}

.brand-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.brand-ribbon {
    display: inline-block;
    background: var(--color-primary-dark);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Formulario */
.form-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(243,244,246,0.75);
    margin-bottom: 0.45rem;
    letter-spacing: 0.02em;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
}

.input-icon svg { width: 17px; height: 17px; }

.form-control {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.6rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    outline: none;
}

.form-control::placeholder { color: var(--text-muted); font-size: 0.88rem; }

.form-control:focus {
    border-color: var(--input-border-focus);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.12);
}

/* Mostrar/ocultar contraseña */
.btn-toggle-pass {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    display: flex;
    transition: color 0.2s;
}

.btn-toggle-pass:hover { color: var(--text); }
.btn-toggle-pass svg { width: 18px; height: 18px; }

/* Error */
.error-box {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    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 submit */
.btn-login {
    width: 100%;
    padding: 0.9rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.97rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: 0.02em;
}

.btn-login:hover  { background: var(--color-primary-dark); box-shadow: 0 6px 28px rgba(0,0,0,0.4); }
.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 */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Footer de la card */
.card-footer {
    margin-top: 1.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.card-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}

.card-footer a:hover { color: var(--color-accent); }

/* Divisor decorativo */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--card-border), transparent);
    margin: 1.5rem 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; }
}