/**
 * PERSEBAYT public shell — S1
 * Visual language shared with the super-admin workspace.
 */

:root {
    --ps-primary: #177245;
    --ps-primary-dark: #0f5634;
    --ps-primary-soft: #eaf7f0;
    --ps-secondary: #2563eb;
    --ps-page: #f3f7f5;
    --ps-surface: #ffffff;
    --ps-text: #15231b;
    --ps-muted: #64748b;
    --ps-line: #dce7e1;
    --ps-danger: #b42336;
    --ps-radius: 20px;
    --ps-shadow: 0 16px 42px rgba(15, 54, 35, .09);
    --ps-gutter: clamp(12px, 3vw, 28px);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    overflow-x: clip;
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    margin: 0;
    overflow-x: clip;
    background:
        radial-gradient(circle at 8% 2%, rgba(37, 99, 235, .08), transparent 28rem),
        radial-gradient(circle at 95% 8%, rgba(23, 114, 69, .1), transparent 32rem),
        var(--ps-page);
    color: var(--ps-text);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    line-height: 1.75;
}

button,
input,
select,
textarea {
    font: inherit;
}

img {
    max-width: 100%;
}

.ps-container {
    width: min(1160px, calc(100% - (var(--ps-gutter) * 2)));
    margin-inline: auto;
}

.ps-skip {
    position: fixed;
    inset-block-start: 8px;
    inset-inline-start: 8px;
    z-index: 2000;
    translate: 0 -180%;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--ps-primary-dark);
    color: #fff;
}

.ps-skip:focus {
    translate: 0;
}

.ps-header {
    position: sticky;
    inset-block-start: 0;
    z-index: 1030;
    border-block-end: 1px solid rgba(220, 231, 225, .9);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 8px 30px rgba(15, 54, 35, .05);
    backdrop-filter: blur(18px);
}

.ps-header__inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.ps-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--ps-primary-dark);
    text-decoration: none;
}

.ps-brand__mark {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--ps-primary), #28a268);
    color: #fff;
    box-shadow: 0 10px 24px rgba(23, 114, 69, .22);
}

.ps-brand > span:last-child {
    min-width: 0;
    display: grid;
    line-height: 1.25;
}

.ps-brand strong {
    max-width: 190px;
    overflow: hidden;
    font-size: 1.04rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-brand small {
    color: var(--ps-muted);
    font-size: .72rem;
}

.ps-nav {
    min-width: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.ps-nav a,
.ps-action {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 13px;
    color: #334155;
    font-weight: 800;
    text-decoration: none;
    transition: .18s ease;
}

.ps-nav a:hover,
.ps-nav a:focus-visible {
    background: var(--ps-primary-soft);
    color: var(--ps-primary-dark);
}

.ps-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-action {
    border-color: var(--ps-primary);
    background: var(--ps-primary);
    color: #fff;
}

.ps-action:hover,
.ps-action:focus-visible {
    background: var(--ps-primary-dark);
    color: #fff;
}

.ps-action--ghost {
    border-color: var(--ps-line);
    background: #fff;
    color: var(--ps-primary-dark);
}

.ps-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 20%, rgba(255, 255, 255, .16), transparent 18rem),
        linear-gradient(135deg, #0f5634, #177245 58%, #207f50);
    color: #fff;
}

.ps-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: auto -8rem -10rem auto;
    width: 25rem;
    height: 25rem;
    border: 4rem solid rgba(255, 255, 255, .06);
    border-radius: 50%;
}

.ps-hero__inner {
    min-height: 230px;
    display: flex;
    align-items: center;
    gap: clamp(18px, 4vw, 42px);
    padding-block: 44px;
}

.ps-hero__icon {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 28px;
    background: rgba(255, 255, 255, .13);
    font-size: 2.4rem;
    box-shadow: inset 0 1px rgba(255, 255, 255, .24);
    backdrop-filter: blur(12px);
}

.ps-eyebrow {
    display: inline-block;
    margin-block-end: 6px;
    color: #c9f4db;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
}

.ps-hero h1 {
    margin: 0;
    font-size: clamp(1.9rem, 5vw, 3.25rem);
    line-height: 1.25;
}

.ps-hero p {
    max-width: 780px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(.98rem, 2vw, 1.13rem);
}

.content {
    min-height: 42vh;
    padding-block: 30px 46px;
}

.card {
    min-width: 0;
    margin-block-end: 18px;
    overflow-wrap: anywhere;
    border: 1px solid var(--ps-line);
    border-radius: var(--ps-radius);
    padding: clamp(16px, 3vw, 25px);
    background: var(--ps-surface);
    box-shadow: var(--ps-shadow);
}

.card h1,
.card h2,
.card h3 {
    margin-block-start: 0;
    line-height: 1.4;
}

.grid {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
    gap: 16px;
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--ps-primary);
    border-radius: 12px;
    padding: 10px 18px;
    background: var(--ps-primary);
    color: #fff !important;
    cursor: pointer;
    font-weight: 850;
    text-decoration: none;
    transition: .18s ease;
}

.btn:hover,
.btn:focus-visible {
    background: var(--ps-primary-dark);
    border-color: var(--ps-primary-dark);
}

.btn-secondary {
    border-color: var(--ps-line);
    background: #fff;
    color: var(--ps-primary-dark) !important;
}

.field {
    min-width: 0;
    display: grid;
    gap: 7px;
    margin-block-end: 14px;
    color: #34453b;
    font-weight: 750;
}

.field input,
.field textarea,
.field select {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd9d1;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ps-text);
    outline: none;
}

.field textarea {
    min-height: 116px;
    resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--ps-primary);
    box-shadow: 0 0 0 4px rgba(23, 114, 69, .12);
}

.alert {
    margin-block-end: 16px;
    border: 1px solid #bfe7ce;
    border-radius: 13px;
    padding: 12px 15px;
    background: #ebf9f0;
    color: #125c32;
}

.alert.bad {
    border-color: #f1c5cb;
    background: #fff0f2;
    color: var(--ps-danger);
}

.ps-footer {
    border-block-start: 1px solid var(--ps-line);
    background: #fff;
    color: var(--ps-muted);
}

.ps-footer .ps-container {
    min-height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px 18px;
    flex-wrap: wrap;
    padding-block: 18px;
}

.ps-footer strong {
    color: var(--ps-primary-dark);
}

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

@media (max-width: 960px) {
    .ps-header__inner {
        grid-template-columns: auto 1fr;
    }

    .ps-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
        overflow-x: auto;
        padding-block-end: 9px;
        scrollbar-width: none;
    }

    .ps-nav::-webkit-scrollbar {
        display: none;
    }

    .ps-nav a {
        flex: 0 0 auto;
    }

    .ps-header__actions {
        justify-self: end;
    }
}

@media (max-width: 680px) {
    :root {
        --ps-radius: 16px;
        --ps-gutter: 12px;
    }

    body.has-public-bottom-nav {
        padding-block-end: 76px;
    }

    .ps-header__inner {
        min-height: 64px;
        gap: 10px;
    }

    .ps-brand__mark {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 13px;
    }

    .ps-brand small,
    .ps-action--ghost,
    .ps-nav {
        display: none;
    }

    .ps-action {
        min-height: 40px;
        padding-inline: 11px;
        font-size: .8rem;
    }

    .ps-hero__inner {
        min-height: 190px;
        align-items: flex-start;
        gap: 15px;
        padding-block: 34px;
    }

    .ps-hero__icon {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 18px;
        font-size: 1.5rem;
    }

    .ps-hero h1 {
        font-size: clamp(1.65rem, 8vw, 2.25rem);
    }

    .content {
        padding-block-start: 18px;
    }

    .card {
        padding: 15px;
    }

    .ps-bottom-nav {
        position: fixed;
        z-index: 1050;
        inset-inline: max(10px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-right));
        inset-block-end: max(9px, env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        border: 1px solid var(--ps-line);
        border-radius: 18px;
        padding: 6px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 48px rgba(15, 54, 35, .22);
        backdrop-filter: blur(18px);
    }

    .ps-bottom-nav a {
        min-width: 0;
        min-height: 52px;
        display: grid;
        place-items: center;
        gap: 1px;
        border-radius: 12px;
        color: #526157;
        font-size: .7rem;
        font-weight: 850;
        text-decoration: none;
    }

    .ps-bottom-nav a:first-child {
        background: var(--ps-primary-soft);
        color: var(--ps-primary-dark);
    }

    .ps-bottom-nav i {
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    .ps-brand strong {
        max-width: 112px;
        font-size: .88rem;
    }

    .ps-action i {
        display: none;
    }

    .ps-hero__inner {
        display: grid;
    }

    .ps-hero__icon {
        width: 52px;
        height: 52px;
    }

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

