* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #1A2933;
    background: #F8F8F5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-shell {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    min-height: 100vh;
}

/* === PANEL IZQUIERDO (BRAND) === */
.login-brand {
    position: relative;
    overflow: hidden;
    background: #1F4F5C;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 440px;
    text-align: center;
}

.brand-logo {
    width: 200px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
    margin-bottom: 2rem;
}

.login-brand-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 1rem;
    color: rgba(255,255,255,0.95);
    letter-spacing: -0.01em;
}

.brand-tagline {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.55;
    margin: 0 0 3rem;
}

.brand-footer {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}

.brand-footer img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    background: rgba(255,255,255,0.95);
    border-radius: 4px;
    padding: 2px;
}

.brand-footer small {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.55);
}

.brand-footer strong {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.95);
    font-weight: 600;
}

/* === PANEL DERECHO (FORM) === */
.login-form-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background:
        radial-gradient(circle at 20% 0%, rgba(31,79,92,0.06), transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(232,93,47,0.06), transparent 40%),
        #FAFAF7;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #FFFFFF;
    border-radius: 14px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 14px 40px rgba(31,79,92,0.10), 0 2px 6px rgba(0,0,0,0.04);
    border: 1px solid rgba(31,79,92,0.06);
}

.login-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    color: #1F4F5C;
}

.login-header p {
    font-size: 0.9rem;
    color: #5A6B73;
    margin: 0 0 2rem;
}

.login-error {
    background: #FEEDEC;
    color: #C44820;
    border-left: 3px solid #E85D2F;
    padding: 0.7rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 1.2rem;
}

.login-error:empty { display: none; }

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

.form-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1F4F5C;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
    width: 100%;
    padding: 0.75rem 0.95rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1A2933;
    background: #FAFAF7;
    border: 1.5px solid #E0E0E0;
    border-radius: 8px;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-field input:focus {
    border-color: #1F4F5C;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(31,79,92,0.10);
}

.form-field input::placeholder {
    color: #9E9E9E;
}

.field-error {
    display: block;
    color: #C62828;
    font-size: 0.78rem;
    margin-top: 0.3rem;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.4rem 0 1.6rem;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #1A2933;
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: #1F4F5C;
    cursor: pointer;
}

.form-row a {
    font-size: 0.85rem;
    color: #E85D2F;
    text-decoration: none;
    font-weight: 500;
}

.form-row a:hover { text-decoration: underline; }

.btn-primary {
    width: 100%;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #1F4F5C 0%, #143842 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: 0 4px 12px rgba(31,79,92,0.20);
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(31,79,92,0.28);
}

.btn-primary:active {
    transform: translateY(1px);
}

.register-link {
    text-align: center;
    margin: 1.4rem 0 0;
    font-size: 0.85rem;
    color: #5A6B73;
}

.register-link a {
    color: #E85D2F;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover { text-decoration: underline; }

.login-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #E0E0E0;
    text-align: center;
    font-size: 0.72rem;
    color: #9E9E9E;
    letter-spacing: 0.02em;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .login-shell {
        grid-template-columns: 1fr;
    }
    .login-brand {
        min-height: 220px;
        padding: 2rem;
    }
    .brand-logo {
        width: 140px;
        margin-bottom: 1rem;
    }
    .login-brand-content h2 {
        font-size: 1.05rem;
    }
    .brand-tagline {
        margin-bottom: 1rem;
    }
    .brand-footer { display: none; }
    .login-form-wrap {
        padding: 2rem 1.25rem;
    }
    .login-card {
        padding: 2rem 1.5rem;
    }
}
