:root {
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-soft: #eef2ff;
    --canvas: #f4f7fb;
    --danger: #dc2626;
    --success: #15803d;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
    min-height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

.login-atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.atmosphere-shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(720px 420px at 8% 0%, rgba(79, 70, 229, 0.1), transparent 55%),
        radial-gradient(640px 380px at 100% 100%, rgba(14, 165, 233, 0.08), transparent 52%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.atmosphere-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100dvh;
}

.brand-mark {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    margin-bottom: 36px;
}

.mark-seal {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--primary);
}

.mark-seal.compact {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.brand-mark strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0.18em;
    line-height: 1;
}

.brand-mark span {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--muted);
}

.login-stage {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    overflow: hidden;
    background: #fff;
}

.hero-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px 56px 40px;
    color: var(--ink);
    overflow: hidden;
    background:
        linear-gradient(165deg, #f5f7ff 0%, #eef4fb 48%, #f8fafc 100%);
    border-right: 1px solid #e8edf5;
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.glow-1 {
    width: 340px;
    height: 340px;
    top: -120px;
    left: -80px;
    background: rgba(79, 70, 229, 0.12);
}

.glow-2 {
    width: 280px;
    height: 280px;
    bottom: -90px;
    right: -60px;
    background: rgba(14, 165, 233, 0.1);
}

.hero-rings {
    position: absolute;
    width: 520px;
    height: 520px;
    right: -200px;
    bottom: -220px;
    border-radius: 50%;
    border: 68px solid rgba(79, 70, 229, 0.06);
    pointer-events: none;
}

.hero-rings::after {
    content: "";
    position: absolute;
    inset: 70px;
    border-radius: 50%;
    border: 40px solid rgba(14, 165, 233, 0.05);
}

.hero-top,
.hero-kicker,
.hero-title,
.hero-lead,
.module-grid,
.hero-footer,
.hero-note {
    position: relative;
}

.hero-top {
    flex: 1;
}

.hero-kicker {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 999px;
    padding: 6px 12px;
    margin-bottom: 22px;
}

.hero-title {
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    font-size: clamp(36px, 4.2vw, 52px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}

.hero-title::after {
    content: "";
    display: block;
    width: 72px;
    height: 4px;
    margin-top: 18px;
    border-radius: 99px;
    background: linear-gradient(90deg, #4f46e5, #38bdf8);
}

.hero-lead {
    max-width: 44ch;
    font-size: 16px;
    line-height: 1.7;
    color: #5b6b80;
}

.module-grid {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 36px 0 22px;
}

.module-grid li {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 15px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8edf5;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.module-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.mod-units .module-icon {
    color: #4f46e5;
    background: #eef2ff;
}

.mod-clients .module-icon {
    color: #0284c7;
    background: #e0f2fe;
}

.mod-sales .module-icon {
    color: #059669;
    background: #d1fae5;
}

.mod-properties .module-icon {
    color: #d97706;
    background: #fef3c7;
}

.module-grid strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.module-grid span {
    font-size: 12.5px;
    color: var(--muted);
}

.hero-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.note-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

.hero-footer {
    display: grid;
    gap: 14px;
}

.developer-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e8edf5;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.dev-avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
    background: linear-gradient(160deg, #6366f1, #3730a3);
}

.dev-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 3px;
}

.dev-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
}

.dev-line {
    font-size: 12px;
    color: var(--muted);
}

.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    min-height: 100%;
    background: #fff;
    position: relative;
}

.form-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3730a3, #4f46e5, #38bdf8);
}

.form-content {
    width: 100%;
    max-width: 400px;
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.mobile-brand-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.mobile-brand-sub {
    font-size: 12px;
    color: var(--muted);
}

.form-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}

.form-title {
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 10px;
}

.form-subtitle {
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--muted);
    margin-bottom: 28px;
}

.login-error,
.login-success {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    animation: shake 0.45s ease both;
}

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

.login-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--success);
}

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

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 7px;
}

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

.input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 44px;
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 500;
    color: var(--ink);
    background: #fff;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-wrapper input:hover {
    border-color: #c7d2fe;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.field-validation-error {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--danger);
    margin-top: 6px;
}

.input-wrapper input[type="password"],
.input-wrapper input[type="text"]#Password {
    padding-right: 48px;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

.toggle-password {
    position: absolute;
    right: 4px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

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

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 22px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.remember-me input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-box {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 5px;
    color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.remember-me input:checked ~ .checkbox-box {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.remember-me input:focus-visible ~ .checkbox-box,
.toggle-password:focus-visible,
.btn-login:focus-visible,
.forgot-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

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

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
    transition: background 0.2s ease, transform 0.2s var(--ease), box-shadow 0.2s ease;
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(79, 70, 229, 0.28);
}

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

.btn-login:disabled {
    cursor: wait;
    opacity: 0.86;
}

.btn-login .btn-arrow {
    transition: transform 0.2s var(--ease);
}

.btn-login:hover .btn-arrow {
    transform: translateX(3px);
}

.btn-login .btn-spinner svg {
    animation: spin 0.8s linear infinite;
}

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

.form-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 22px;
    font-size: 12px;
    color: #94a3b8;
}

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

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

    .login-shell,
    .login-stage {
        height: auto;
        min-height: 100dvh;
    }

    .login-stage {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: none;
    }

    .mobile-brand {
        display: flex;
    }

    .form-panel {
        padding: 36px 28px;
        min-height: 100dvh;
    }
}

@media (max-width: 480px) {
    .form-panel {
        padding: 28px 20px 32px;
        align-items: flex-start;
    }

    .form-title {
        font-size: 32px;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-height: 780px) and (min-width: 981px) {
    .hero-panel,
    .form-panel {
        padding-top: 32px;
        padding-bottom: 24px;
    }

    .module-grid {
        margin: 20px 0 16px;
    }

    .hero-title {
        font-size: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}