﻿* {
    box-sizing: border-box;
}

:root {
    --primary: #5b5fef;
    --primary-dark: #4145c8;
    --accent: #ff7657;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --text: #171a2b;
    --muted: #6d7284;
    --border: #e5e7f0;
    --danger: #d92d20;
}

html,
body {
    min-height: 100%;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
}

.login-hero {
    position: relative;
    overflow: hidden;
    margin: 18px;
    padding: 56px;
    display: flex;
    flex-direction: column;
    color: white;
    border-radius: 32px;
    background: linear-gradient(145deg, #4b4fd8, #7377ff);
}

.hero-orb {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.orb-one {
    width: 300px;
    height: 300px;
    right: -90px;
    top: -80px;
    background: rgba(255, 255, 255, .1);
}

.orb-two {
    width: 340px;
    height: 340px;
    left: -80px;
    bottom: -120px;
    background: rgba(255, 118, 87, .28);
}

.app-brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 11px;
    font-size: 23px;
    font-weight: 900;
}

.app-brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-size: 16px;
}

.app-brand.light .app-brand-mark {
    background: white;
    color: var(--primary);
}

.login-hero-copy {
    position: relative;
    z-index: 2;
    margin-top: auto;
    max-width: 720px;
}

.login-hero-copy h1 {
    margin: 0;
    font-size: clamp(38px, 4.1vw, 60px);
    line-height: 1.08;
    letter-spacing: -1.8px;
}

.login-hero-copy p {
    max-width: 650px;
    margin: 20px 0 0;
    color: #e4e5ff;
    font-size: 18px;
    line-height: 1.55;
}

.login-form-side {
    display: grid;
    place-items: center;
    padding: 30px;
}

.login-card {
    width: min(100%, 460px);
    padding: 32px 28px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: white;
}

.login-heading {
    margin-top: 34px;
}

.app-eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 1.3px;
}

.login-heading h2 {
    margin: 9px 0 10px;
    font-size: 30px;
    line-height: 1.1;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.form-error ul {
    margin: 22px 0 0;
    padding: 13px 15px;
    list-style: none;
    border-radius: 14px;
    color: var(--danger);
    background: #fff0ee;
    font-weight: 600;
}

.login-form {
    margin-top: 26px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin: 0 0 7px 3px;
    color: #383c4f;
    font-size: 13px;
    font-weight: 750;
}

.input-wrap {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    transition: .16s ease;
}

.input-wrap:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 95, 239, .1);
}

.input-icon {
    width: 28px;
    color: var(--primary);
    font-size: 18px;
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    padding: 16px 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.field-error {
    display: block;
    margin: 6px 0 0 3px;
    color: var(--danger);
    font-size: 12px;
}

.remember-row {
    margin: 2px 2px 18px;
    padding: 10px 11px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 14px;
    color: var(--text);
    background: #f8f8ff;
    cursor: pointer;
    user-select: none;
}
.remember-row input {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: 0 0 18px;
    accent-color: var(--primary);
}
.remember-copy { display: grid; gap: 3px; }
.remember-copy strong { font-size: 14px; line-height: 1.25; }
.remember-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.login-button {
    width: 100%;
    min-height: 54px;
    margin-top: 6px;
    border: 0;
    border-radius: 16px;
    color: white;
    background: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

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

.register-line {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
}

.register-line a {
    color: var(--primary);
    font-weight: 800;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.desktop-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: white;
}

.side-nav {
    display: grid;
    gap: 6px;
    margin-top: 34px;
}

.side-nav a {
    padding: 13px 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 700;
}

.side-nav a.active {
    color: var(--primary);
    background: #eeeeff;
}

.logout-form {
    margin-top: auto;
}

.logout-form button {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--muted);
    cursor: pointer;
}

.app-main {
    min-width: 0;
}

.mobile-app-header {
    display: none;
}

.app-content {
    max-width: 1050px;
    margin: 0 auto;
    padding: 50px 34px 110px;
}

.welcome-block h1 {
    margin: 9px 0 8px;
    font-size: 34px;
}

.welcome-block p {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 28px;
}

.dashboard-card {
    padding: 20px;
    display: flex;
    gap: 15px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
}

.dashboard-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    color: var(--primary);
    background: #eeeeff;
    font-size: 22px;
}

.dashboard-card h3 {
    margin: 2px 0 5px;
}

.dashboard-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.mobile-bottom-nav {
    display: none;
}

.icon-button {
    border: 0;
    background: transparent;
    color: var(--primary);
}

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

    .login-hero {
        display: none;
    }

    .login-form-side {
        min-height: 100vh;
        padding: 24px;
    }

    .login-card {
        padding: 32px 28px;
    }

    .app-shell {
        display: block;
    }

    .desktop-sidebar {
        display: none;
    }

    .mobile-app-header {
        position: sticky;
        top: 0;
        z-index: 10;
        min-height: 68px;
        padding: 12px 18px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--border);
        background: rgba(255, 255, 255, .94);
        backdrop-filter: blur(16px);
    }

    .mobile-app-header .app-brand {
        font-size: 20px;
    }

    .mobile-app-header .app-brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 13px;
    }

    .app-content {
        padding: 28px 18px 110px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        min-height: 72px;
        padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        border-top: 1px solid var(--border);
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(18px);
    }

    .mobile-bottom-nav a {
        display: grid;
        place-items: center;
        gap: 2px;
        color: #8b8fa0;
        font-size: 19px;
    }

    .mobile-bottom-nav a.active {
        color: var(--primary);
    }

    .mobile-bottom-nav small {
        font-size: 10px;
        font-weight: 700;
    }
}

@media (max-width: 520px) {
    .login-form-side {
        padding: 0;
        background: white;
    }

    .login-card {
        min-height: 100vh;
        width: 100%;
        padding: 28px 22px;
        border: 0;
        border-radius: 0;
    }

    .login-heading {
        margin-top: 38px;
    }
}
