:root {
    --red-900: #5c0d10;
    --red-800: #7a1216;
    --red-700: #99181c;
    --red-600: #b91c1c;
    --red-500: #c92a2f;
    --red-400: #e0575c;
    --cream: #fdf7f2;
    --ink-900: #1f2430;
    --ink-600: #4b5262;
    --ink-400: #8890a0;
    --line: #eceef2;
    --ok: #1a7f4b;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body.login-body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    font-family: "Segoe UI", "Inter", Arial, sans-serif;
    background: var(--cream);
    color: var(--ink-900);
}

/* ---------- Left brand panel ---------- */

.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 56px 40px;
    color: #fff;
    background:
        radial-gradient(1100px 700px at 12% -10%, rgba(255, 255, 255, 0.14), transparent 55%),
        linear-gradient(155deg, var(--red-700) 0%, var(--red-800) 55%, var(--red-900) 100%);
}

.login-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.09) 1.5px, transparent 1.5px);
    background-size: 26px 26px;
    opacity: 0.5;
    pointer-events: none;
}

.login-brand::after {
    content: "";
    position: absolute;
    width: 620px;
    height: 620px;
    right: -220px;
    bottom: -260px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.10), transparent 65%);
    pointer-events: none;
}

.login-brand > * {
    position: relative;
    z-index: 1;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark .badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}

.brand-mark .badge img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-mark .brand-text {
    line-height: 1.25;
}

.brand-mark .brand-text strong {
    display: block;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.brand-mark .brand-text span {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.login-brand .headline {
    margin-top: 64px;
    max-width: 440px;
}

.login-brand .headline h1 {
    font-size: 34px;
    line-height: 1.28;
    margin: 0 0 14px;
    font-weight: 700;
}

.login-brand .headline p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
}

.brand-features {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.9);
}

.brand-features .icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-features svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
}

.login-brand .brand-footer {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- Right form panel ---------- */

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    animation: card-in 0.5s ease both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card .card-head {
    margin-bottom: 30px;
}

.login-card .card-head .eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red-600);
    margin: 0 0 8px;
}

.login-card .card-head h2 {
    font-size: 24px;
    margin: 0 0 6px;
    color: var(--ink-900);
}

.login-card .card-head p {
    margin: 0;
    font-size: 13.5px;
    color: var(--ink-400);
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #fdecec;
    border: 1px solid #f6c6c6;
    color: #8a1f1f;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    animation: shake 0.4s ease;
}

.alert svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke: #8a1f1f;
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-600);
    margin-bottom: 7px;
}

.field .input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field .input-wrap:focus-within {
    border-color: var(--red-600);
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.10);
}

.field .input-wrap .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    flex-shrink: 0;
    color: var(--ink-400);
}

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

.field input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14.5px;
    padding: 12px 12px 12px 0;
    color: var(--ink-900);
    font-family: inherit;
}

.field .toggle-visibility {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-400);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.field .toggle-visibility:hover {
    color: var(--ink-600);
}

.field .toggle-visibility.is-visible {
    color: var(--red-600);
}

.field .toggle-visibility svg {
    width: 18px;
    height: 18px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 13px;
}

.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-600);
    cursor: pointer;
    user-select: none;
}

.checkbox-wrap input {
    accent-color: var(--red-600);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.forgot-link {
    color: var(--red-600);
    text-decoration: none;
    font-weight: 600;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-submit {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14.5px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--red-600), var(--red-800));
    box-shadow: 0 8px 20px rgba(153, 24, 28, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(153, 24, 28, 0.34);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.75;
    cursor: default;
    transform: none;
}

.btn-submit .spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
    display: none;
}

.btn-submit.is-loading .spinner {
    display: inline-block;
}

.btn-submit.is-loading .btn-label {
    opacity: 0.85;
}

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

.login-card .card-foot {
    margin-top: 26px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-400);
}

.field.has-error .input-wrap {
    border-color: var(--red-600);
}

@media (max-width: 880px) {
    body.login-body {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .login-panel {
        padding: 48px 20px;
    }
}
