:root {
    --ink: #30283d;
    --ink-soft: #6c6378;
    --surface: #fffdfd;
    --surface-muted: #f9f6fa;
    --line: #e8dfea;
    --violet: #8d62c7;
    --violet-deep: #5f3a8e;
    --violet-dark: #442761;
    --parme: #cbb3df;
    --parme-soft: #f0e8f6;
    --pink: #e99abf;
    --pink-soft: #fae8f0;
    --rose: #edb4ca;
    --peach: #f3c5c2;
    --green: #4ca584;
    --red: #b74464;
    --red-soft: #fff0f4;
    --shadow-small: 0 10px 28px rgb(73 49 88 / 8%);
    --shadow-large: 0 26px 70px rgb(73 49 88 / 14%);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: #faf8fb;
    font-family:
        Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
a {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
    outline: 3px solid rgb(141 98 199 / 34%);
    outline-offset: 3px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

.eyebrow {
    margin: 0 0 0.55rem;
    color: var(--violet);
    font-size: 0.73rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 3.5rem;
    height: 3.5rem;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 1.1rem;
    color: white;
    background: linear-gradient(145deg, var(--violet-deep), var(--pink));
    box-shadow: 0 13px 30px rgb(95 58 142 / 28%);
    font-size: 1.1rem;
    font-weight: 900;
}

.brand-mark-small {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
}

/* Authentication */

.auth-page {
    overflow-x: hidden;
    background:
        radial-gradient(
            circle at 94% 4%,
            rgb(233 154 191 / 22%),
            transparent 23rem
        ),
        #faf8fb;
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(25rem, 0.9fr) minmax(28rem, 1.1fr);
}

.brand-panel {
    position: relative;
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 5rem);
    flex-direction: column;
    justify-content: space-between;
    color: white;
    background:
        radial-gradient(
            circle at 82% 12%,
            rgb(255 255 255 / 20%),
            transparent 16rem
        ),
        radial-gradient(
            circle at 7% 92%,
            rgb(233 154 191 / 38%),
            transparent 20rem
        ),
        linear-gradient(145deg, #4f2d73 0%, #8558b4 50%, #cf79aa 100%);
}

.brand-panel::before,
.brand-panel::after {
    position: absolute;
    content: "";
    border: 1px solid rgb(255 255 255 / 17%);
    border-radius: 50%;
}

.brand-panel::before {
    right: -11rem;
    bottom: -9rem;
    width: 30rem;
    height: 30rem;
}

.brand-panel::after {
    right: -5rem;
    bottom: -15rem;
    width: 38rem;
    height: 38rem;
}

.brand-heading,
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 1.1rem;
    font-weight: 850;
}

.brand-heading .brand-mark {
    background: rgb(255 255 255 / 16%);
    box-shadow: none;
    backdrop-filter: blur(15px);
}

.brand-message {
    position: relative;
    z-index: 1;
    max-width: 38rem;
    padding: 4rem 0;
}

.brand-message .eyebrow {
    color: #f2dbea;
}

.brand-message h1 {
    margin-bottom: 1.6rem;
    font-size: clamp(3rem, 5.5vw, 5.8rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
}

.brand-message > p:last-child {
    max-width: 33rem;
    margin-bottom: 0;
    color: rgb(255 255 255 / 82%);
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.75;
}

.brand-signature {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgb(255 255 255 / 68%);
    font-size: 0.84rem;
}

.login-panel {
    display: grid;
    min-height: 100vh;
    padding: clamp(2rem, 7vw, 7rem);
    place-items: center;
}

.login-card {
    width: min(100%, 30rem);
}

.login-card h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.15rem, 4vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.muted {
    color: var(--ink-soft);
    line-height: 1.6;
}

.login-form {
    display: grid;
    margin-top: 2.25rem;
    gap: 1.25rem;
}

.field {
    display: grid;
    gap: 0.5rem;
}

.field label {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 750;
}

.field input {
    width: 100%;
    min-height: 3.45rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.9rem;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 4px 18px rgb(73 49 88 / 4%);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.field input::placeholder {
    color: #aaa1b2;
}

.field input:hover {
    border-color: var(--parme);
}

.field input:focus {
    border-color: var(--violet);
    outline: 0;
    box-shadow: 0 0 0 4px rgb(141 98 199 / 12%);
    transform: translateY(-1px);
}

.primary-button,
.secondary-button,
.light-button {
    display: inline-flex;
    min-height: 2.85rem;
    border: 0;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform 160ms ease,
        box-shadow 160ms ease,
        background 160ms ease;
}

.primary-button {
    min-height: 3.45rem;
    padding: 0.85rem 1.25rem;
    color: white;
    background: linear-gradient(135deg, var(--violet-deep), #a967bc);
    box-shadow: 0 13px 28px rgb(95 58 142 / 22%);
}

.primary-button:hover {
    box-shadow: 0 16px 34px rgb(95 58 142 / 30%);
    transform: translateY(-2px);
}

.secondary-button {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--line);
    color: var(--violet-deep);
    background: var(--surface);
    font-size: 0.82rem;
}

.secondary-button:hover {
    border-color: var(--parme);
    background: var(--parme-soft);
}

.light-button {
    width: fit-content;
    padding: 0.75rem 1rem;
    color: var(--violet-deep);
    background: white;
    box-shadow: 0 10px 28px rgb(57 31 77 / 16%);
}

.light-button:hover {
    box-shadow: 0 14px 34px rgb(57 31 77 / 25%);
    transform: translateY(-2px);
}

.alert {
    margin-top: 1.3rem;
    padding: 0.9rem 1rem;
    border: 1px solid #f2c2d0;
    border-radius: 0.85rem;
    color: var(--red);
    background: var(--red-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}

.privacy-note {
    margin: 1.4rem 0 0;
    color: var(--ink-soft);
    font-size: 0.77rem;
    text-align: center;
}

.mobile-brand {
    display: none;
}

/* Dashboard */

.dashboard-page {
    background:
        radial-gradient(
            circle at 96% 2%,
            rgb(233 154 191 / 20%),
            transparent 25rem
        ),
        radial-gradient(
            circle at 2% 13%,
            rgb(203 179 223 / 24%),
            transparent 26rem
        ),
        #faf8fb;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 4.75rem;
    padding: 0 4vw;
    border-bottom: 1px solid rgb(232 223 234 / 82%);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: rgb(255 253 253 / 88%);
    backdrop-filter: blur(18px);
}

.brand-link,
.user-menu,
.user-identity,
.section-heading,
.module-card-top {
    display: flex;
    align-items: center;
}

.brand-link {
    gap: 0.8rem;
    font-weight: 850;
    text-decoration: none;
}

.desktop-nav {
    display: flex;
    gap: 0.3rem;
}

.desktop-nav a {
    padding: 0.65rem 0.9rem;
    border-radius: 0.75rem;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
    color: var(--violet-deep);
    background: var(--parme-soft);
}

.user-menu {
    gap: 0.75rem;
}

.user-identity {
    align-items: flex-end;
    flex-direction: column;
    line-height: 1.2;
}

.user-identity strong {
    font-size: 0.86rem;
}

.user-identity small {
    color: var(--ink-soft);
    font-size: 0.72rem;
}

.avatar {
    display: grid;
    width: 2.45rem;
    height: 2.45rem;
    place-items: center;
    border: 1px solid #ead6e2;
    border-radius: 50%;
    color: var(--violet-deep);
    background: var(--pink-soft);
    font-size: 0.8rem;
    font-weight: 900;
}

.dashboard {
    width: min(100% - 2rem, 78rem);
    margin: 0 auto;
    padding: 2.5rem 0 5rem;
}

.dashboard-intro {
    display: flex;
    margin-bottom: 1.5rem;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-intro h1 {
    margin-bottom: 0.35rem;
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    letter-spacing: -0.06em;
}

.dashboard-intro > div > p:last-child {
    margin: 0;
    color: var(--ink-soft);
}

.version-pill,
.tag {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-soft);
    background: rgb(255 253 253 / 74%);
    font-size: 0.74rem;
    font-weight: 750;
}

.version-pill {
    padding: 0.6rem 0.85rem;
}

.hero-card {
    position: relative;
    display: grid;
    min-height: 23rem;
    overflow: hidden;
    padding: clamp(2rem, 4vw, 3.5rem);
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
    border-radius: 2rem;
    color: white;
    background:
        radial-gradient(
            circle at 100% 15%,
            rgb(255 255 255 / 20%),
            transparent 20rem
        ),
        linear-gradient(120deg, #53317a 0%, #8960b9 51%, #ca78ad 100%);
    box-shadow: var(--shadow-large);
}

.hero-card::before,
.hero-card::after {
    position: absolute;
    content: "";
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 50%;
}

.hero-card::before {
    right: -8rem;
    bottom: -15rem;
    width: 35rem;
    height: 35rem;
}

.hero-card::after {
    right: -3rem;
    bottom: -12rem;
    width: 25rem;
    height: 25rem;
}

.hero-copy,
.hero-summary {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    margin-bottom: 0.8rem;
    color: #f4ddea;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hero-copy h2 {
    max-width: 15ch;
    margin-bottom: 1rem;
    font-size: clamp(2.25rem, 4.5vw, 3.7rem);
    line-height: 1.02;
    letter-spacing: -0.055em;
}

.hero-copy > p:not(.hero-eyebrow) {
    max-width: 36rem;
    margin-bottom: 1.55rem;
    color: rgb(255 255 255 / 80%);
    line-height: 1.65;
}

.hero-summary {
    display: grid;
    gap: 0.8rem;
}

.hero-summary article {
    display: flex;
    min-height: 3.75rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid rgb(255 255 255 / 18%);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: 1rem;
    background: rgb(255 255 255 / 8%);
    backdrop-filter: blur(10px);
}

.hero-summary span {
    color: rgb(255 255 255 / 72%);
    font-size: 0.78rem;
}

.hero-summary strong {
    font-size: 0.9rem;
    text-align: right;
}

.dashboard-section {
    padding-top: 2.7rem;
}

.section-heading {
    margin-bottom: 1rem;
    justify-content: space-between;
    gap: 1rem;
}

.section-heading h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
    letter-spacing: -0.035em;
}

.section-note {
    color: var(--violet-deep);
    font-size: 0.78rem;
    font-weight: 750;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.module-card {
    position: relative;
    display: flex;
    min-height: 15rem;
    overflow: hidden;
    padding: 1.4rem;
    border: 1px solid var(--line);
    flex-direction: column;
    justify-content: space-between;
    border-radius: 1.35rem;
    background: rgb(255 253 253 / 90%);
    box-shadow: var(--shadow-small);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.module-card::after {
    position: absolute;
    right: -2.5rem;
    bottom: -3rem;
    width: 7.5rem;
    height: 7.5rem;
    content: "";
    border-radius: 50%;
    background: var(--card-accent, var(--parme-soft));
}

.module-card:hover {
    border-color: var(--parme);
    box-shadow: 0 18px 42px rgb(73 49 88 / 13%);
    transform: translateY(-4px);
}

.module-card-top {
    position: relative;
    z-index: 1;
    justify-content: space-between;
    gap: 0.75rem;
}

.module-icon {
    display: grid;
    width: 2.9rem;
    height: 2.9rem;
    place-items: center;
    border-radius: 0.9rem;
    color: var(--violet-deep);
    background: var(--icon-accent, var(--parme-soft));
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.tag {
    padding: 0.38rem 0.55rem;
    border: 0;
    background: var(--surface-muted);
}

.tag-primary {
    color: var(--violet-deep);
    background: var(--parme-soft);
}

.module-card > div:not(.module-card-top),
.module-link {
    position: relative;
    z-index: 1;
}

.module-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
}

.module-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.55;
}

.module-link {
    color: var(--violet-deep);
    font-size: 0.77rem;
    font-weight: 800;
}

.module-training {
    --card-accent: #eadcf5;
    --icon-accent: #eee3f7;
}

.module-equipment {
    --card-accent: #f8ddea;
    --icon-accent: #fae5ef;
}

.module-utilities {
    --card-accent: #f9dfdd;
    --icon-accent: #fbe7e5;
}

.module-documents {
    --card-accent: #e8dff0;
    --icon-accent: #f0eaf4;
}

.dashboard-lower-grid {
    display: grid;
    margin-top: 1rem;
    grid-template-columns: 1.35fr 0.65fr;
    gap: 1rem;
}

.dashboard-panel {
    padding: 1.4rem;
    border: 1px solid var(--line);
    border-radius: 1.35rem;
    background: rgb(255 253 253 / 90%);
    box-shadow: var(--shadow-small);
}

.compact-heading {
    margin-bottom: 1.1rem;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.quick-actions article {
    display: flex;
    min-height: 6.25rem;
    padding: 1rem;
    border: 1px solid var(--line);
    align-items: flex-start;
    gap: 0.8rem;
    border-radius: 1rem;
    background: var(--surface-muted);
}

.quick-index {
    color: var(--pink);
    font-size: 0.7rem;
    font-weight: 900;
}

.quick-actions h3 {
    margin-bottom: 0.3rem;
    font-size: 0.86rem;
}

.quick-actions p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.74rem;
    line-height: 1.45;
}

.system-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 1rem;
    list-style: none;
}

.system-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.system-list li > span:last-child {
    display: grid;
    gap: 0.15rem;
}

.system-list strong {
    font-size: 0.82rem;
}

.system-list small {
    color: var(--ink-soft);
    font-size: 0.7rem;
}

.status-dot {
    width: 0.62rem;
    height: 0.62rem;
    flex: 0 0 auto;
    border: 2px solid #cce9df;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgb(76 165 132 / 9%);
}

.mobile-nav {
    display: none;
}

@media (max-width: 1040px) {
    .desktop-nav {
        display: none;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .auth-layout {
        display: block;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 1.25rem;
        place-items: start center;
        background:
            radial-gradient(
                circle at 100% 0%,
                rgb(233 154 191 / 28%),
                transparent 19rem
            ),
            radial-gradient(
                circle at 0% 35%,
                rgb(203 179 223 / 28%),
                transparent 22rem
            );
    }

    .mobile-brand {
        display: flex;
        width: min(100%, 30rem);
        margin-bottom: clamp(3rem, 11vh, 6rem);
    }

    .login-card h2 {
        font-size: 2.35rem;
    }

    .topbar {
        min-height: 4.4rem;
        padding: 0 1rem;
    }

    .user-identity,
    .user-menu form {
        display: none;
    }

    .dashboard {
        padding-top: 1.5rem;
        padding-bottom: 6.8rem;
    }

    .dashboard-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-intro h1 {
        font-size: 2.65rem;
    }

    .hero-card {
        min-height: auto;
        padding: 1.5rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
        border-radius: 1.4rem;
    }

    .hero-copy h2 {
        font-size: 2.35rem;
    }

    .hero-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-summary article {
        min-height: 7.4rem;
        padding: 0.8rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-summary strong {
        font-size: 0.82rem;
        text-align: left;
    }

    .section-heading {
        align-items: flex-start;
    }

    .section-note {
        max-width: 10rem;
        text-align: right;
    }

    .module-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .module-card {
        min-height: 13rem;
    }

    .mobile-nav {
        position: fixed;
        z-index: 30;
        right: 0.8rem;
        bottom: 0.8rem;
        left: 0.8rem;
        display: grid;
        min-height: 4.15rem;
        padding: 0.4rem;
        grid-template-columns: repeat(4, 1fr);
        border: 1px solid var(--line);
        border-radius: 1.2rem;
        background: rgb(255 253 253 / 94%);
        box-shadow: var(--shadow-large);
        backdrop-filter: blur(18px);
    }

    .mobile-nav a {
        display: grid;
        place-items: center;
        border-radius: 0.85rem;
        color: var(--ink-soft);
        font-size: 0.68rem;
        font-weight: 800;
        text-decoration: none;
    }

    .mobile-nav a[aria-current="page"] {
        color: var(--violet-deep);
        background: var(--parme-soft);
    }
}

@media (max-width: 450px) {
    .dashboard {
        width: min(100% - 1.25rem, 78rem);
    }

    .hero-copy h2 {
        font-size: 2.05rem;
    }

    .hero-summary {
        gap: 0.5rem;
    }

    .hero-summary article {
        padding: 0.7rem;
    }

    .hero-summary span {
        font-size: 0.66rem;
    }

    .hero-summary strong {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
