/* =========================================
   AUTOBACKLINK AUTH UI
========================================= */

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

:root {
    --navy: #0f172a;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --text: #0f172a;
    --muted: #64748b;
    --light: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --white: #fff;
    --danger: #dc2626;
    --success: #15803d;
    --radius: 10px;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

.login-page {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: 50% 50%;
    overflow: hidden;
}

.brand-section {
    height: 100vh;
    background: var(--navy);
    color: white;
    display: flex;
    align-items: center;
    padding: 40px 8%;
}

.brand-content {
    width: 100%;
    max-width: 560px;
    margin: auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--blue);
    color: white;
    font-size: 20px;
    font-weight: 800;
}

.brand-logo h1 {
    font-size: 19px;
    line-height: 1.2;
}

.brand-logo span,
.mobile-brand span {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}

.brand-message {
    margin-top: 70px;
}

.brand-message h2 {
    font-size: clamp(38px, 4vw, 54px);
    line-height: 1.05;
    letter-spacing: -2px;
}

.brand-message h2 span {
    color: #60a5fa;
}

.brand-message p {
    max-width: 440px;
    margin-top: 20px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.65;
}

.feature-list {
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 13px;
}

.feature-icon {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, .2);
    color: #60a5fa;
    font-size: 10px;
}

.login-section {
    height: 100vh;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 7%;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 390px;
}

.mobile-brand {
    display: none;
}

.login-header {
    margin-bottom: 25px;
}

.login-header h2 {
    font-size: 29px;
    line-height: 1.15;
    letter-spacing: -.8px;
}

.login-header p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label,
.label-row label {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
}

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

.forgot-link {
    color: var(--blue);
    font-size: 11px;
    text-decoration: none;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 12px;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    height: 46px;
    padding: 0 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 13px;
    color: var(--text);
    background: white;
    transition: border-color .2s, box-shadow .2s;
}

.input-wrapper input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}

.password-toggle {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--blue);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.form-options {
    margin-top: -1px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.remember-me input {
    width: 14px;
    height: 14px;
    accent-color: var(--blue);
}

.login-error {
    padding: 9px 12px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    font-size: 11px;
    line-height: 1.45;
}

.register-success {
    padding: 9px 12px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
    font-size: 11px;
    line-height: 1.45;
}

.login-button,
.demo-button {
    width: 100%;
    height: 46px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.login-button {
    border: 0;
    background: var(--blue);
    color: white;
}

.login-button:hover {
    background: var(--blue-dark);
}

.login-button:disabled {
    opacity: .7;
    cursor: wait;
}

.demo-button {
    border: 1px solid var(--border);
    background: white;
    color: #334155;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.divider span {
    color: #94a3b8;
    font-size: 11px;
}

.register-text {
    margin-top: 19px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.register-text a {
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: #94a3b8;
    font-size: 10px;
}

.login-footer div {
    display: flex;
    gap: 14px;
}

.login-footer a {
    color: #64748b;
    text-decoration: none;
}

.loader {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

@media (min-width: 901px) and (max-height: 700px) {
    .brand-section { padding: 25px 8%; }
    .brand-message { margin-top: 40px; }
    .brand-message h2 { font-size: 42px; }
    .brand-message p { margin-top: 14px; }
    .feature-list { margin-top: 22px; gap: 9px; }
    .login-section { padding: 20px 7%; }
    .login-header { margin-bottom: 18px; }
    .login-header h2 { font-size: 26px; }
    .login-form { gap: 13px; }
    .login-footer { margin-top: 20px; }
}

@media (max-width: 900px) {
    body {
        overflow: auto;
    }

    .login-page {
        height: auto;
        min-height: 100vh;
        display: block;
        overflow: visible;
    }

    .brand-section {
        display: none;
    }

    .login-section {
        min-height: 100vh;
        height: auto;
        padding: 30px 20px;
        overflow: visible;
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 11px;
        margin-bottom: 42px;
    }

    .mobile-brand h1 {
        font-size: 18px;
    }

    .login-container {
        max-width: 390px;
    }
}

@media (max-width: 480px) {
    .login-section {
        padding: 24px 18px;
    }

    .login-header h2 {
        font-size: 27px;
    }

    .login-footer {
        flex-direction: column;
        gap: 10px;
    }
}
