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

:root {
    --accent:      #5b8dee;
    --accent-h:    #4a7be0;
    --brand-from:  #6a85b6;
    --brand-to:    #bac8e0;
    --gray-50:     #f8fafc;
    --gray-100:    #f1f5f9;
    --gray-200:    #e2e8f0;
    --gray-400:    #94a3b8;
    --gray-600:    #64748b;
    --gray-800:    #334155;
    --radius:      12px;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gray-100);
}

/* ── Layout ── */
.login-wrap {
    display: flex;
    min-height: 100vh;
}

/* ── Panel izquierdo (branding) ── */
.login-brand {
    flex: 1;
    background: linear-gradient(160deg, #6a85b6 0%, #9ab0cc 55%, #bac8e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    top: -120px;
    right: -120px;
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    bottom: -70px;
    left: -50px;
}

.brand-inner {
    text-align: center;
    z-index: 1;
    animation: fadeUp .7s ease both;
}

.brand-logo {
    width: 155px;
    max-width: 70%;
    margin-bottom: 1.75rem;
    filter: drop-shadow(0 4px 18px rgba(0,0,0,.12));
}

.brand-name {
    font-size: 1.7rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
    margin-bottom: .45rem;
    text-shadow: 0 1px 6px rgba(0,0,0,.12);
}

.brand-sub {
    font-size: .92rem;
    color: rgba(255,255,255,.8);
    font-weight: 400;
    letter-spacing: .3px;
}

/* ── Panel derecho (formulario) ── */
.login-form-wrap {
    width: 460px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 370px;
    animation: fadeUp .6s .1s ease both;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: .35rem;
}

.login-header p {
    font-size: .88rem;
    color: var(--gray-400);
}

/* ── Campos ── */
.field-group {
    margin-bottom: 1.2rem;
}

.field-group label {
    display: block;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-600);
    margin-bottom: .4rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: .85rem;
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
    flex-shrink: 0;
}

.input-wrap input[type=text],
.input-wrap input[type=password] {
    width: 100%;
    padding: .72rem 2.6rem .72rem 2.5rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: .93rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.input-wrap input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91,141,238,.12);
}

.input-wrap input::placeholder {
    color: #c0cfe0;
    font-size: .88rem;
}

.toggle-pass {
    position: absolute;
    right: .7rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: .25rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    transition: color .2s;
}
.toggle-pass:hover { color: var(--gray-600); }
.toggle-pass svg { width: 16px; height: 16px; }

/* ── Mensajes ── */
#error {
    padding: .65rem .9rem;
    border-radius: 8px;
    font-size: .86rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

#error.error {
    background: #fff1f2;
    color: #be3455;
    border: 1px solid #fecdd3;
}

#error.success {
    background: #f0fdf4;
    color: #2d8653;
    border: 1px solid #bbf7d0;
}

/* ── Botón ── */
input[type=submit] {
    width: 100%;
    padding: .8rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .96rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(91,141,238,.3);
    letter-spacing: .2px;
    margin-top: .2rem;
}

input[type=submit]:hover {
    background: var(--accent-h);
    box-shadow: 0 6px 20px rgba(91,141,238,.4);
}

input[type=submit]:active {
    transform: scale(.98);
}

/* ── Footer ── */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: .78rem;
    color: var(--gray-400);
}

.login-footer strong {
    color: var(--gray-600);
}

/* ── Animación ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .login-wrap { flex-direction: column; }

    .login-brand {
        flex: none;
        padding: 2.5rem 2rem;
    }

    .brand-logo { width: 90px; margin-bottom: .9rem; }
    .brand-name { font-size: 1.25rem; }

    .login-form-wrap {
        width: 100%;
        padding: 2rem 1.5rem;
        flex: 1;
    }
}

@media (max-width: 400px) {
    .login-form-wrap { padding: 1.5rem 1rem; }
}
