:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe3ef;
    --surface: #ffffff;
    --background: #f8fafc;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(460px, 0.95fr) minmax(520px, 1.05fr);
}

.brand-panel {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #ffffff;
    background:
        linear-gradient(
            145deg,
            rgba(8, 20, 49, 0.98),
            rgba(23, 74, 168, 0.94)
        );
}

.brand-panel::before,
.brand-panel::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
}

.brand-panel::before {
    width: 500px;
    height: 500px;
    top: -230px;
    right: -200px;
    background: rgba(96, 165, 250, 0.2);
}

.brand-panel::after {
    width: 360px;
    height: 360px;
    left: -180px;
    bottom: -150px;
    background: rgba(59, 130, 246, 0.22);
}

.brand-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.08) 1px,
            transparent 1px
        );
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 1;
}

.brand-logo,
.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: inherit;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.brand-logo strong,
.mobile-brand strong {
    color: #7dd3fc;
}

.brand-icon {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.13);
    backdrop-filter: blur(14px);
    font-size: 20px;
}

.brand-icon img {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 9px;
    object-fit: contain;
}

.brand-message {
    max-width: 610px;
    margin-top: 80px;
}

.eyebrow,
.welcome-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #bfdbfe;
}

.brand-message h1 {
    margin: 22px 0 20px;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.brand-message h1 span {
    display: block;
    color: #7dd3fc;
}

.brand-message > p {
    max-width: 580px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 17px;
    line-height: 1.75;
}

.feature-list {
    margin-top: 44px;
    display: grid;
    gap: 16px;
}

.feature-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    align-items: center;
}

.feature-item > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.11);
    color: #bae6fd;
}

.feature-item strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.feature-item small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 12px;
    line-height: 1.5;
}

.brand-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 12px;
}

.form-panel {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px;
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(219, 234, 254, 0.7),
            transparent 30%
        ),
        #ffffff;
}

.form-container {
    width: min(440px, 100%);
}

.mobile-brand {
    display: none;
    margin-bottom: 38px;
    color: var(--secondary);
}

.mobile-brand .brand-icon {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: var(--primary);
}

.mobile-brand strong {
    color: var(--primary);
}

.form-heading {
    margin-bottom: 34px;
}

.welcome-label {
    margin-bottom: 18px;
    background: #eff6ff;
    color: var(--primary);
}

.form-heading h2 {
    margin: 0 0 12px;
    font-size: clamp(30px, 3vw, 40px);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.form-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
}

.form-group {
    margin-bottom: 21px;
}

.form-group label {
    display: inline-block;
    margin-bottom: 9px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.forgot-link {
    margin-bottom: 9px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

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

.input-wrapper {
    position: relative;
}

.input-wrapper > i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 54px;
    padding: 0 50px 0 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #a8b3c4;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.input-wrapper.has-error input {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.toggle-password {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.toggle-password:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.field-error {
    display: block;
    min-height: 17px;
    padding-top: 6px;
    color: var(--danger);
    font-size: 11px;
    font-weight: 600;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.remember-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-checkbox {
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: transparent;
    font-size: 10px;
    transition: 0.2s ease;
}

.remember-option input:checked + .custom-checkbox {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.icon-challenge {
    margin: 2px 0 18px;
    padding: 0;
    border: 0;
}

.icon-challenge legend {
    margin-bottom: 10px;
    color: #334155;
    font-size: 13px;
}

.icon-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
}

.icon-options label {
    position: relative;
    cursor: pointer;
}

.icon-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.icon-options span {
    min-height: 48px;
    display: grid;
    place-items: center;
    border-right: 1px solid #e2e8f0;
    color: #334155;
    font-size: 20px;
    transition: 0.18s ease;
}

.icon-options label:last-child span {
    border-right: 0;
}

.icon-options label:hover span {
    background: #eff6ff;
    color: var(--primary);
}

.icon-options input:focus-visible + span {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: -3px;
}

.icon-options input:checked + span {
    background: var(--primary);
    color: #ffffff;
}

.icon-challenge.has-error .icon-options {
    border-color: #ef4444;
}

.login-button {
    width: 100%;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    border: 0;
    border-radius: 14px;
    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );
    color: #ffffff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.24);
    cursor: pointer;
    font-weight: 800;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(37, 99, 235, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.login-button.is-loading i {
    animation: spin 0.8s linear infinite;
}

.security-note {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 11px;
}

.security-note i {
    color: var(--success);
}

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

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

    .brand-panel {
        display: none;
    }

    .form-panel {
        padding: 36px 22px;
    }

    .mobile-brand {
        display: inline-flex;
    }
}

@media (max-width: 480px) {
    .form-heading h2 {
        font-size: 30px;
    }

    .label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0;
    }

    .forgot-link {
        order: 2;
        margin-top: -4px;
        margin-bottom: 10px;
    }
}
