/* app/static/login.css */

:root {
    --brand-red: #d83a2e;
    --brand-red-dark: #ae221c;
    --brand-blue: rgba(17, 34, 54, 0.8);
    --panel: rgba(24, 31, 41, 0.38);
    --panel-border: rgba(255, 255, 255, 0.16);
    --text-light: #f2f5f8;
    --text-dim: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.26);
    --button-red: #db2a28;
    --button-red-dark: #b51f1d;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    overflow: hidden;
    color: var(--text-light);
    background-color: #0f172a;
    background-blend-mode: multiply;
    user-select: none;
}

body::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(88, 12, 18, 0.7) 0%, rgba(71, 38, 48, 0.7) 24%, rgba(16, 36, 52, 0.72) 60%, rgba(16, 36, 52, 0.7) 100%);
    opacity: 0.9;
}

.brand-background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.18;
}

.brand-word {
    position: absolute;
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
    font-size: clamp(5rem, 12vw, 18rem);
    font-weight: 900;
    letter-spacing: -0.08em;
    line-height: 0.82;
    color: rgba(219, 53, 40, 0.78);
    text-shadow: 6px 6px 0 rgba(8, 14, 20, 0.12);
    font-family: Impact, Haettenschweiler, 'Arial Black', sans-serif;
    transform-origin: center;
    white-space: nowrap;
}

.brand-line {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    width: min(90vw, 1100px);
    text-align: center;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: clamp(1.15rem, 2.2vw, 2.1rem);
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    line-height: 1.2;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 1rem;
}

.brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

.logo-login {
    max-height: 120px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

.brand-subtitle {
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.login-panel {
    width: min(100%, 430px);
    transform: translateY(-1.25rem);
    padding: 2rem 1.75rem 1.7rem;
    border-radius: 1.2rem;
    background: rgba(31, 32, 35, 0.42);
    border: 1px solid var(--panel-border);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 12px 26px rgba(46, 92, 193, 0.32);
    color: #fff;
    font-size: 1.8rem;
}

.login-panel h1 {
    margin: 0 0 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: clamp(1.8rem, 2.2vw, 2.4rem);
    font-weight: 800;
}

.flash-message {
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    background: rgba(220, 38, 38, 0.16);
    border-left: 4px solid #ef4444;
    border-radius: 0.6rem;
    color: #fef2f2;
    font-size: 0.9rem;
}

.flash-message p {
    margin: 0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.input-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-light);
    padding: 0.9rem 0.9rem 0.9rem 0;
    font-size: 0.95rem;
}

.input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.login-form button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.95rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, var(--button-red) 0%, var(--button-red-dark) 100%);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(211, 39, 39, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(211, 39, 39, 0.4);
}

.footer-login {
    position: relative;
    z-index: 1;
    padding: 1rem 1rem 1.4rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    text-align: center;
    letter-spacing: 0.02em;
}

@media (max-width: 640px) {
    .brand-word {
        top: 48%;
        font-size: clamp(4.2rem, 23vw, 7rem);
    }

    .brand-line {
        bottom: 14%;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .brand-header {
        margin-top: 0.6rem;
    }

    .logo-login {
        max-height: 90px;
    }

    .login-panel {
        padding: 1.4rem 1rem 1.3rem;
        border-radius: 1rem;
    }

    .login-panel h1 {
        font-size: 1.8rem;
    }

    .field-group label {
        letter-spacing: 0.04em;
    }
}

/* En ventanas bajas (por ejemplo, laptops con barra de tareas visible), se
   compacta el acceso para que la tarjeta completa permanezca centrada. */
@media (max-height: 800px) {
    .login-shell {
        padding-top: 0.5rem;
    }

    .brand-header {
        margin-top: 0;
        margin-bottom: 1.2rem;
    }

    .logo-login {
        max-height: 100px;
    }

    .brand-subtitle {
        margin-top: 0.45rem;
    }

    .login-panel {
        transform: translateY(-0.5rem);
        padding: 1.4rem 1.75rem 1.1rem;
    }

    .login-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 0.7rem;
        font-size: 1.55rem;
    }

    .login-panel h1 {
        margin-bottom: 1rem;
    }

    .login-form {
        gap: 0.85rem;
    }

    .field-group {
        gap: 0.4rem;
    }

    .input-wrap input {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    .login-form button {
        margin-top: 0.35rem;
        padding: 0.8rem 1rem;
    }

    .footer-login {
        padding: 0.75rem 1rem 0.35rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .login-panel,
    .login-form button {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
}
