/* =========================================================
   LA2 PROJECT v0.6.2 — Cabinet + Logout hotfix
   Separate stylesheet: does not replace public/css/style.css
   ========================================================= */

/* Header logout button */
.nav-logout-form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-logout {
    appearance: none;
    -webkit-appearance: none;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 9px;
    background: rgba(10, 16, 27, 0.72);
    color: rgba(245, 247, 251, 0.82);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.nav-logout:hover {
    color: #10131a;
    border-color: rgba(237, 193, 96, 0.88);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-1px);
}

/* Cabinet hero */
.cabinet-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 74px 0 68px;
    border-bottom: 1px solid var(--line);
    background: #050810;
}

.cabinet-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(
            90deg,
            rgba(4, 8, 15, 0.90) 0%,
            rgba(4, 8, 15, 0.61) 52%,
            rgba(4, 8, 15, 0.88) 100%
        ),
        linear-gradient(
            to bottom,
            rgba(5, 8, 16, 0.20),
            rgba(5, 8, 16, 0.88)
        ),
        var(--cabinet-image) center 45% / cover no-repeat;
    transform: scale(1.025);
}

.cabinet-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 55%;
    z-index: -1;
    background: linear-gradient(to bottom, transparent, #050810);
    pointer-events: none;
}

.cabinet-hero-compact {
    padding-top: 58px;
    padding-bottom: 54px;
}

.cabinet-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 34px;
}

.cabinet-welcome > div {
    min-width: 0;
}

.cabinet-welcome h1 {
    max-width: 840px;
    margin: 12px 0 12px;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 34px rgba(0, 0, 0, 0.54);
}

.cabinet-welcome p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.68;
}

.cabinet-welcome > .button {
    flex: 0 0 auto;
    min-width: 190px;
}

/* Cabinet body */
.cabinet-section {
    position: relative;
    min-height: 480px;
    padding: 42px 0 100px;
    background:
        radial-gradient(circle at 50% 0, rgba(32, 58, 89, 0.16), transparent 34%),
        var(--bg);
}

.cabinet-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: 19px 20px;
    border: 1px solid rgba(237, 193, 96, 0.26);
    border-radius: 14px;
    background:
        linear-gradient(
            90deg,
            rgba(213, 165, 59, 0.11),
            rgba(12, 19, 31, 0.88) 55%
        );
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.cabinet-notice > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.cabinet-notice strong {
    color: var(--gold-light);
    font-size: 15px;
}

.cabinet-notice span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.cabinet-notice form {
    flex: 0 0 auto;
    margin: 0;
}

.button-small {
    min-width: 160px;
    min-height: 42px;
    padding-inline: 17px;
    font-size: 13px;
}

/* Account statistics */
.cabinet-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.cabinet-stat {
    position: relative;
    min-height: 164px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 25px 26px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            rgba(17, 26, 41, 0.97),
            rgba(8, 14, 24, 0.98)
        );
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.20);
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.motion-enabled .cabinet-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(213, 165, 59, 0.24);
    box-shadow: 0 23px 48px rgba(0, 0, 0, 0.26);
}

.cabinet-stat::after {
    content: "";
    position: absolute;
    right: -45px;
    bottom: -60px;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    background: rgba(213, 165, 59, 0.055);
    filter: blur(4px);
    pointer-events: none;
}

.cabinet-stat-primary {
    border-color: rgba(213, 165, 59, 0.35);
    background:
        radial-gradient(circle at 90% 15%, rgba(213, 165, 59, 0.12), transparent 30%),
        linear-gradient(145deg, rgba(22, 30, 44, 0.98), rgba(9, 15, 25, 0.98));
}

.cabinet-stat > span {
    color: rgba(226, 233, 244, 0.60);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}

.cabinet-stat > strong {
    display: block;
    margin-top: 13px;
    color: #ffffff;
    font-size: clamp(28px, 3vw, 39px);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.cabinet-stat-primary > strong {
    color: var(--gold-light);
}

.cabinet-stat > small {
    display: block;
    margin-top: 9px;
    color: rgba(229, 235, 245, 0.47);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.cabinet-status-text {
    font-size: 25px !important;
}

.cabinet-status-text.is-success {
    color: #83e3b2 !important;
}

.cabinet-status-text.is-warning {
    color: var(--gold-light) !important;
}

/* Main cabinet panels */
.cabinet-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.cabinet-panel {
    overflow: hidden;
    padding: 28px 30px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            rgba(17, 26, 41, 0.96),
            rgba(8, 14, 24, 0.98)
        );
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.19);
}

.cabinet-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.cabinet-panel-heading h2 {
    margin: 9px 0 0;
    font-size: 27px;
}

.cabinet-panel-heading > a {
    flex: 0 0 auto;
    padding-bottom: 3px;
    color: var(--gold-light);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.cabinet-panel-heading > a:hover {
    text-decoration: underline;
}

.cabinet-empty {
    margin: 0;
    color: var(--muted);
}

.security-events {
    display: grid;
}

.security-event {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
    padding: 15px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.security-event:last-child {
    border-bottom: 0;
}

.security-event-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    background: rgba(229, 235, 245, 0.32);
    box-shadow: 0 0 0 4px rgba(229, 235, 245, 0.035);
}

.security-event-dot.is-success {
    background: #56d596;
    box-shadow: 0 0 0 4px rgba(86, 213, 150, 0.075);
}

.security-event-dot.is-danger {
    background: #f46f7c;
    box-shadow: 0 0 0 4px rgba(244, 111, 124, 0.075);
}

.security-event strong {
    display: block;
    color: rgba(245, 247, 251, 0.94);
    font-size: 14px;
    line-height: 1.35;
}

.security-event small {
    display: block;
    margin-top: 5px;
    color: rgba(229, 235, 245, 0.44);
    font-size: 12px;
    line-height: 1.45;
}

/* Profile page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.profile-grid .form-card {
    min-width: 0;
}

.form-card-heading {
    padding: 29px 34px 0;
}

.form-card-heading h2 {
    margin: 9px 0 0;
    font-size: 27px;
}

.profile-grid .form-group small {
    display: block;
    margin-top: 8px;
    color: rgba(229, 235, 245, 0.46);
    font-size: 12px;
    line-height: 1.45;
}

/* Responsive */
@media (max-width: 980px) {
    .cabinet-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

    .cabinet-stats,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-stat {
        min-height: 142px;
    }
}

@media (max-width: 640px) {
    .nav {
        row-gap: 10px;
    }

    .nav-logout {
        min-height: 34px;
        padding: 8px 11px;
    }

    .cabinet-hero,
    .cabinet-hero-compact {
        padding-top: 48px;
        padding-bottom: 46px;
    }

    .cabinet-welcome h1 {
        font-size: 36px;
    }

    .cabinet-welcome > .button {
        width: 100%;
    }

    .cabinet-section {
        padding-top: 30px;
        padding-bottom: 72px;
    }

    .cabinet-notice {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .cabinet-notice .button {
        width: 100%;
    }

    .cabinet-stats {
        gap: 14px;
    }

    .cabinet-panel {
        padding: 23px 20px;
    }

    .cabinet-panel-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .form-card-heading {
        padding: 25px 20px 0;
    }
}
