:root {
    --bg-gradient:
        linear-gradient(
            135deg,
            #d5f2d6 0%,
            #e8f5e9 50%,
            #ffffff 100%
        );

    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-bg-hover: rgba(255, 255, 255, 0.45);
    --glass-border: rgba(255, 255, 255, 0.6);

    --glass-shadow:
        0 16px 40px rgba(0, 0, 0, 0.04),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);

    --primary-color: #2e7d32;
    --primary-btn: rgba(76, 175, 80, 0.85);
    --primary-btn-hover: rgba(67, 160, 71, 1);

    --ease-out-back: cubic-bezier(0.34, 1.25, 0.64, 1);
    --ease-smooth: cubic-bezier(0.25, 0.8, 0.25, 1);
}


/* =========================================================
   BASE
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding:
        max(40px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(40px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));

    min-height: 100svh;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: var(--bg-gradient);
    background-attachment: fixed;

    display: flex;
    justify-content: center;
    align-items: center;

    position: relative;

    color: #2c3e50;

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    overflow-x: hidden;
}


/* На мобильных fixed background может быть тяжёлым */
@media (max-width: 700px) {
    body {
        background-attachment: scroll;
    }
}


/* =========================================================
   CONTROL PLANE LINK
   ========================================================= */

.control-plane-link {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));

    color: rgba(46, 125, 50, 0.7);
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;

    padding: 10px 18px;

    border-radius: 14px;
    border: 1px solid var(--glass-border);

    background: var(--glass-bg);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    transition:
        background-color 0.2s var(--ease-smooth),
        border-color 0.2s var(--ease-smooth),
        color 0.2s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth);
}

@media (hover: hover) and (pointer: fine) {
    .control-plane-link:hover {
        background: var(--glass-bg-hover);
        color: var(--primary-color);

        box-shadow:
            0 6px 20px rgba(46, 125, 50, 0.12);
    }
}

.control-plane-link:active {
    transform: scale(0.97);
}

.control-plane-link:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 4px rgba(129, 199, 132, 0.18);
}


/* =========================================================
   GLASS PANELS
   ========================================================= */

.glass-panel,
.glass-container {
    background: var(--glass-bg);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    border: 1px solid var(--glass-border);

    box-shadow: var(--glass-shadow);

    will-change: auto;
}


/* Основная форма */
.glass-panel {
    width: min(420px, 100%);

    padding: 44px;

    border-radius: 28px;
}


/* Админка */
.glass-container {
    width: min(860px, 100%);

    padding: 40px;

    border-radius: 28px;

    margin: 40px 20px;
}


/* =========================================================
   HEADINGS
   ========================================================= */

h1,
h2 {
    margin-top: 0;

    color: var(--primary-color);

    font-weight: 600;
    letter-spacing: -0.5px;

    line-height: 1.2;
}

h2 {
    text-align: center;
    margin-bottom: 28px;
}


/* =========================================================
   INPUTS
   ========================================================= */

input[type="text"],
input[type="password"],
textarea {
    display: block;

    width: 100%;

    padding: 14px 16px;

    margin: 0 0 20px;

    border: 1px solid rgba(255, 255, 255, 0.5);

    border-radius: 16px;

    background: rgba(255, 255, 255, 0.15);

    color: #2c3e50;

    font-family: inherit;
    font-size: 16px;

    line-height: 1.4;

    outline: none;

    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.02);

    -webkit-appearance: none;
    appearance: none;

    transition:
        background-color 0.2s var(--ease-smooth),
        border-color 0.2s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth);
}

input::placeholder,
textarea::placeholder {
    color: rgba(0, 0, 0, 0.35);
}

input:focus,
textarea:focus {
    border-color: rgba(129, 199, 132, 0.9);

    background: rgba(255, 255, 255, 0.5);

    box-shadow:
        0 0 0 4px rgba(129, 199, 132, 0.18),
        inset 0 2px 4px rgba(0, 0, 0, 0.01);
}


/* =========================================================
   TEXTAREA
   ========================================================= */

textarea {
    resize: none;
    overflow-y: hidden;

    min-height: 110px;

    line-height: 1.5;
}


/* =========================================================
   BUTTONS
   ========================================================= */

button,
.btn {
    -webkit-tap-highlight-color: transparent;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 48px;

    padding: 15px;

    background: var(--primary-btn);

    color: white;

    border: 1px solid var(--glass-border);

    border-radius: 16px;

    font-family: inherit;
    font-size: 15px;
    font-weight: 600;

    line-height: 1.2;

    cursor: pointer;

    user-select: none;

    touch-action: manipulation;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    transition:
        background-color 0.2s var(--ease-smooth),
        border-color 0.2s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth),
        opacity 0.2s var(--ease-smooth);
}

button:focus-visible,
.btn:focus-visible {
    outline: none;

    box-shadow:
        0 0 0 4px rgba(129, 199, 132, 0.2);
}

button:active,
.btn:active {
    transform: scale(0.97);
}

button:disabled,
.btn:disabled {
    cursor: default;
    opacity: 0.55;
    transform: none !important;
}


/* Hover только для настоящей мыши */
@media (hover: hover) and (pointer: fine) {
    button:hover,
    .btn:hover {
        background: var(--primary-btn-hover);

        box-shadow:
            0 8px 25px rgba(76, 175, 80, 0.28);

        transform: translateY(-2px);
    }
}


/* =========================================================
   ADMIN REVIEW CARD
   ========================================================= */

.review-card {
    background: rgba(255, 255, 255, 0.35);

    border-radius: 20px;

    padding: 24px;

    margin-bottom: 20px;

    border: 1px solid rgba(255, 255, 255, 0.6);

    transition:
        background-color 0.2s var(--ease-smooth),
        border-color 0.2s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth),
        opacity 0.3s var(--ease-smooth),
        transform 0.3s var(--ease-out-back);
}

@media (hover: hover) and (pointer: fine) {
    .review-card:hover {
        background: rgba(255, 255, 255, 0.55);

        transform: translateY(-3px);

        box-shadow:
            0 12px 30px rgba(0, 0, 0, 0.04);
    }
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-flex;
    align-items: center;

    flex-shrink: 0;

    font-size: 11px;

    padding: 6px 12px;

    border-radius: 12px;

    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}

.pending {
    background: rgba(255, 193, 7, 0.25);
    color: #b78103;
}

.published {
    background: rgba(76, 175, 80, 0.2);
    color: #1b5e20;
}

.rejected {
    background: rgba(244, 67, 54, 0.2);
    color: #b71c1c;
}

.archived {
    background: rgba(158, 158, 158, 0.2);
    color: #424242;
}


/* =========================================================
   MODERATION ACTIONS
   ========================================================= */

.actions {
    margin-top: 20px;

    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

.actions .btn {
    width: auto;

    min-height: 42px;

    padding: 10px 18px;

    font-size: 13px;

    border-radius: 12px;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


/* Publish */
.actions .btn-pub {
    color: #1b5e20;

    background: rgba(76, 175, 80, 0.2);

    border-color: rgba(76, 175, 80, 0.4);
}

@media (hover: hover) and (pointer: fine) {
    .actions .btn-pub:hover {
        background: rgba(76, 175, 80, 0.4);

        box-shadow:
            0 4px 15px rgba(76, 175, 80, 0.25);
    }
}


/* Reject */
.actions .btn-rej {
    color: #b71c1c;

    background: rgba(244, 67, 54, 0.15);

    border-color: rgba(244, 67, 54, 0.35);
}

@media (hover: hover) and (pointer: fine) {
    .actions .btn-rej:hover {
        background: rgba(244, 67, 54, 0.3);

        box-shadow:
            0 4px 15px rgba(244, 67, 54, 0.2);
    }
}


/* Archive */
.actions .btn-arc {
    color: #424242;

    background: rgba(158, 158, 158, 0.2);

    border-color: rgba(158, 158, 158, 0.4);
}

@media (hover: hover) and (pointer: fine) {
    .actions .btn-arc:hover {
        background: rgba(158, 158, 158, 0.35);

        box-shadow:
            0 4px 15px rgba(158, 158, 158, 0.2);
    }
}


/* Delete */
.actions .btn-del {
    color: #ffffff;

    background: rgba(211, 47, 47, 0.85);

    border-color: rgba(211, 47, 47, 0.6);
}

@media (hover: hover) and (pointer: fine) {
    .actions .btn-del:hover {
        background: rgba(211, 47, 47, 1);

        box-shadow:
            0 4px 15px rgba(211, 47, 47, 0.4);
    }
}


/* =========================================================
   ERROR
   ========================================================= */

.error {
    color: #d32f2f;

    font-size: 14px;

    margin-bottom: 18px;

    font-weight: 500;

    text-align: center;
}


/* =========================================================
   TOAST
   ========================================================= */

.toast-notification {
    position: fixed;

    top: max(30px, env(safe-area-inset-top));
    left: 50%;

    max-width: calc(100vw - 32px);

    transform: translateX(-50%) translateY(0);

    display: flex;
    align-items: center;
    gap: 9px;

    background: rgba(76, 175, 80, 0.25);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 1px solid rgba(76, 175, 80, 0.5);

    color: #1b5e20;

    padding: 14px 20px;

    border-radius: 16px;

    font-weight: 600;
    font-size: 15px;

    white-space: nowrap;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.06);

    z-index: 1000;

    animation:
        slideDown 0.4s var(--ease-out-back);
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 21px;
    height: 21px;

    flex-shrink: 0;

    border-radius: 50%;

    background: rgba(76, 175, 80, 0.25);
}

.toast-notification.is-hiding {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition:
        opacity 0.35s var(--ease-smooth),
        transform 0.35s var(--ease-smooth);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 700px) {

    body {
        padding:
            max(20px, env(safe-area-inset-top))
            max(14px, env(safe-area-inset-right))
            max(20px, env(safe-area-inset-bottom))
            max(14px, env(safe-area-inset-left));

        align-items: center;
    }

    .control-plane-link {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));

        padding: 8px 12px;

        font-size: 12px;

        border-radius: 12px;
    }

    .glass-panel {
        padding: 28px 20px;

        border-radius: 22px;

        max-width: 100%;
    }

    .glass-container {
        padding: 22px 16px;

        margin: 12px 0;

        max-width: 100%;

        border-radius: 22px;
    }

    h2 {
        margin-bottom: 24px;

        font-size: 22px;
    }

    input[type="text"],
    input[type="password"],
    textarea {
        padding: 14px 15px;

        font-size: 16px;

        border-radius: 14px;
    }

    button {
        width: 100%;

        min-height: 48px;
    }

    .review-card {
        padding: 18px;

        margin-bottom: 14px;

        border-radius: 17px;
    }

    .review-card > div:first-child {
        align-items: flex-start !important;
    }

    .review-card p {
        font-size: 15px !important;
        line-height: 1.55 !important;
    }

    .actions {
        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 8px;

        margin-top: 16px;
    }

    .actions .btn {
        width: 100%;

        min-height: 44px;

        padding: 10px 8px;

        font-size: 12px !important;
    }

    .status {
        padding: 5px 9px;

        font-size: 10px;
    }

    .toast-notification {
        top: max(14px, env(safe-area-inset-top));

        max-width: calc(100vw - 28px);

        padding: 12px 16px;

        font-size: 14px;

        white-space: normal;

        text-align: center;
    }
}


/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 380px) {

    body {
        padding-left: 10px;
        padding-right: 10px;
    }

    .glass-panel {
        padding: 24px 16px;

        border-radius: 20px;
    }

    .glass-container {
        padding: 18px 12px;

        border-radius: 20px;
    }

    .review-card {
        padding: 15px;
    }

    .actions .btn {
        font-size: 11px !important;
        padding-left: 5px;
        padding-right: 5px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
    }

    .toast-notification {
        animation: none;
    }

    button,
    .btn,
    .control-plane-link,
    .review-card,
    input,
    textarea {
        transition: none !important;
    }
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (pointer: coarse) {
    button,
    .btn,
    .control-plane-link {
        min-height: 44px;
    }
}
