.tgk-card {
    max-width: 720px;
    margin: 24px auto;
    padding: 28px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.tgk-card h2 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 28px;
    line-height: 1.2;
}

.tgk-intro p,
.tgk-muted {
    margin-top: 0;
}

.tgk-muted {
    opacity: 0.75;
    font-size: 14px;
}

.tgk-form {
    margin-top: 18px;
}

.tgk-field {
    margin-bottom: 18px;
}

.tgk-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.tgk-field input[type="text"],
.tgk-field textarea,
.tgk-field select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.22);
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 16px;
    background: #fff;
    color: #111;
}

.tgk-options {
    display: grid;
    gap: 8px;
}

.tgk-options label,
.tgk-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 500;
}

.tgk-button {
    display: inline-block;
    border: 0;
    border-radius: 999px;
    padding: 12px 20px;
    background: var(--tgk-button, #7c3aed);
    color: #fff !important;
    font-weight: 800;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
}

.tgk-button:hover,
.tgk-button:focus {
    background: var(--tgk-button-hover, #5b21b6);
    color: #fff !important;
}

.tgk-message {
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0;
}

.tgk-message-success {
    background: #d1e7dd;
    color: #0f5132;
}

.tgk-message-error,
.tgk-error {
    background: #f8d7da;
    color: #842029;
}

.tgk-info-block {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.tgk-required {
    color: #b91c1c;
}

.tgk-hidden-field {
    position: absolute;
    left: -9999px;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.tgk-turnstile-wrap {
    margin-top: 10px;
}

@media (max-width: 640px) {
    .tgk-card {
        margin: 12px;
        padding: 20px;
        border-radius: 14px;
    }

    .tgk-card h2 {
        font-size: 24px;
    }
}

.tgk-simple-captcha-wrap input[type="text"] {
    max-width: 220px;
}

.tgk-auto-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Automatic gate page hero */
.tgk-auto-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.tgk-hero {
    position: relative;
    overflow: hidden;
    padding: 72px 18px;
    color: #fff;
    text-align: center;
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.22), transparent 26%),
        radial-gradient(circle at 82% 15%, rgba(255, 255, 255, 0.16), transparent 24%),
        linear-gradient(135deg, var(--tgk-hero-start, #2e1065) 0%, var(--tgk-hero-mid, #7c3aed) 48%, var(--tgk-hero-end, #a855f7) 100%);
}

.tgk-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 8px;
    background: rgba(255, 255, 255, 0.22);
}

.tgk-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
}

.tgk-hero-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 14px;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tgk-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 6vw, 68px);
    line-height: 1.05;
    font-weight: 900;
    text-shadow: 0 4px 22px rgba(0, 0, 0, 0.28);
}

.tgk-hero-subtitle {
    max-width: 720px;
    margin: 18px auto 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(17px, 2.3vw, 22px);
    line-height: 1.45;
}

.tgk-auto-form-wrap {
    max-width: 960px;
    margin: -36px auto 0;
    padding: 0 16px 48px;
    position: relative;
    z-index: 2;
}

.tgk-auto-form-wrap .tgk-card {
    margin-top: 0;
}

@media (max-width: 640px) {
    .tgk-hero {
        padding: 54px 16px 64px;
    }

    .tgk-auto-form-wrap {
        margin-top: -28px;
        padding-bottom: 32px;
    }
}


.tgk-status-note {
    border-radius: 14px;
    padding: 14px 16px;
    margin: 16px 0;
    background: rgba(124, 58, 237, 0.09);
    border: 1px solid rgba(124, 58, 237, 0.18);
}

.tgk-action-row {
    margin-top: 14px;
}

.tgk-rules-box {
    margin: 18px 0 22px;
    padding: 18px 20px;
    border-radius: 16px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.18);
}

.tgk-rules-box h3 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.25;
}

.tgk-rules-content p,
.tgk-field-help p {
    margin: 0 0 10px;
}

.tgk-rules-content p:last-child,
.tgk-field-help p:last-child {
    margin-bottom: 0;
}

.tgk-rules-link,
.tgk-field-help a {
    font-weight: 800;
}

.tgk-field-help {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.82;
}


/* Front-end admin panel */
.tgk-front-admin {
    --tgk-admin-purple: #7c3aed;
    --tgk-admin-purple-dark: #4c1d95;
    --tgk-admin-purple-soft: rgba(124, 58, 237, 0.10);
    color: #1f2937;
}

.tgk-front-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 18px;
}

.tgk-front-hero {
    padding: 54px 0 82px;
    color: #fff;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 26%),
        linear-gradient(135deg, #2e1065 0%, #7c3aed 52%, #a855f7 100%);
}

.tgk-front-kicker {
    display: inline-flex;
    margin: 0 0 12px;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    background: rgba(255, 255, 255, 0.14);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tgk-front-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    font-weight: 900;
}

.tgk-front-hero p {
    max-width: 760px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 18px;
}

.tgk-front-panel-wrap {
    margin-top: -44px;
    padding-bottom: 54px;
}

.tgk-front-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.10);
}

.tgk-front-tabs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    color: #4c1d95;
    text-decoration: none;
    font-weight: 800;
}

.tgk-front-tabs a.active,
.tgk-front-tabs a:hover {
    background: var(--tgk-admin-purple);
    color: #fff;
}

.tgk-front-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.tgk-front-stat,
.tgk-front-card,
.tgk-front-gate-card {
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
}

.tgk-front-stat {
    padding: 18px;
}

.tgk-front-stat span {
    display: block;
    color: #4c1d95;
    font-size: 34px;
    line-height: 1;
    font-weight: 900;
}

.tgk-front-stat p {
    margin: 8px 0 0;
    font-weight: 750;
}

.tgk-front-card {
    padding: 18px;
    margin-bottom: 18px;
}

.tgk-front-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.tgk-front-card-head h2 {
    margin: 0;
    font-size: 24px;
}

.tgk-front-gates {
    display: grid;
    gap: 14px;
}

.tgk-front-gate-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
    gap: 16px;
    padding: 16px;
}

.tgk-front-gate-card h3 {
    margin: 0 0 8px;
}

.tgk-front-gate-form {
    display: grid;
    gap: 9px;
    align-content: start;
}

.tgk-front-gate-form label {
    display: grid;
    gap: 5px;
    font-weight: 700;
}

.tgk-front-gate-form select {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.20);
    border-radius: 10px;
    padding: 9px 10px;
    background: #fff;
    color: #111;
}

.tgk-front-small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 9px 13px;
    background: #7c3aed;
    color: #fff !important;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.tgk-front-small-button.ghost {
    background: rgba(124, 58, 237, 0.10);
    color: #4c1d95 !important;
}

.tgk-front-inline {
    display: inline-block;
    margin: 0 5px 5px 0;
}

.tgk-front-muted {
    color: #6b7280;
    font-size: 13px;
}

.tgk-front-table-wrap {
    overflow-x: auto;
}

.tgk-front-table {
    width: 100%;
    border-collapse: collapse;
}

.tgk-front-table th,
.tgk-front-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 11px 9px;
    text-align: left;
    vertical-align: top;
}

.tgk-front-table th {
    color: #4c1d95;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tgk-front-detail-row td {
    background: rgba(124, 58, 237, 0.06);
    color: #4b5563;
    font-size: 13px;
}

.tgk-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 9px;
    background: #e5e7eb;
    color: #111827;
    font-size: 12px;
    font-weight: 800;
    text-transform: capitalize;
}

.tgk-pill-open,
.tgk-pill-passed,
.tgk-pill-approved {
    background: #d1e7dd;
    color: #0f5132;
}

.tgk-pill-paused,
.tgk-pill-manual_review,
.tgk-pill-pending_review,
.tgk-pill-pending_verify,
.tgk-pill-failed {
    background: #fff3cd;
    color: #664d03;
}

.tgk-pill-closed,
.tgk-pill-denied,
.tgk-pill-blocked,
.tgk-pill-error {
    background: #f8d7da;
    color: #842029;
}

@media (max-width: 760px) {
    .tgk-front-gate-card {
        grid-template-columns: 1fr;
    }

    .tgk-front-card-head {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Front-end full editor helpers */
.tgk-front-editor .tgk-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.tgk-front-editor label {
    font-weight: 800;
}

.tgk-front-editor input[type="text"],
.tgk-front-editor input[type="password"],
.tgk-front-editor input[type="url"],
.tgk-front-editor input[type="number"],
.tgk-front-editor input[type="datetime-local"],
.tgk-front-editor textarea,
.tgk-front-editor select,
.tgk-front-editor .widefat,
.tgk-front-ban-form input,
.tgk-front-ban-form textarea,
.tgk-front-ban-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
    color: #111827;
    font-size: 15px;
}

.tgk-front-editor-section {
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-radius: 16px;
    background: rgba(124, 58, 237, 0.035);
}

.tgk-front-editor-section h3 {
    margin-top: 0;
    color: #4c1d95;
}

.tgk-front-save-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    bottom: 12px;
    z-index: 5;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.10);
}

.tgk-front-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tgk-front-small-button.danger {
    background: #dc2626;
    color: #fff !important;
}

.tgk-front-admin .tgk-field-row {
    margin: 14px 0;
    padding: 14px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    border-radius: 16px;
    background: #fff;
}

.tgk-front-admin .tgk-field-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.tgk-front-admin .tgk-field-head .button,
.tgk-front-admin #tgk-add-field {
    border: 0;
    border-radius: 999px;
    padding: 7px 10px;
    background: rgba(124, 58, 237, 0.10);
    color: #4c1d95;
    font-weight: 800;
    cursor: pointer;
}

.tgk-front-admin .tgk-field-title {
    font-weight: 900;
    color: #4c1d95;
}

.tgk-front-admin .tgk-checkbox-line {
    padding-top: 24px;
}

.tgk-front-admin .description {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 13px;
}


.tgk-telegram-login-box {
    margin: 18px 0;
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.18);
    background: rgba(124, 58, 237, 0.07);
    text-align: center;
}

.tgk-telegram-login-box p {
    margin: 0 0 10px;
}

.tgk-telegram-login-box script {
    display: inline-block;
}


.tgk-telegram-login-widget-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    min-height: 50px;
}

.tgk-telegram-login-widget-wrap iframe {
    display: block;
    position: relative;
    z-index: 1;
}

.tgk-telegram-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 240px;
    height: 50px;
    border-radius: 999px;
    background: linear-gradient(180deg, #62b2ef 0%, #4ea2e4 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    box-sizing: border-box;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.tgk-telegram-login-overlay::before {
    content: "✈";
    display: inline-block;
    margin-right: 10px;
    font-size: 15px;
    line-height: 1;
}


.tgk-front-score-grid {
    display: grid;
    gap: 10px;
}

.tgk-front-score-grid label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto 82px auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.tgk-front-score-grid input[type="number"] {
    width: 82px;
    min-width: 82px;
    padding: 7px 8px;
}

@media (max-width: 720px) {
    .tgk-front-score-grid label {
        grid-template-columns: 1fr;
    }

    .tgk-front-score-grid input[type="number"] {
        width: 100%;
    }
}


.tgk-front-admin .tgk-rich-editor-wrap {
    margin: 14px 0;
}

.tgk-front-admin .tgk-rich-editor-wrap > label {
    display: block;
    margin-bottom: 8px;
}

.tgk-front-admin .tgk-rich-editor-wrap .wp-editor-wrap,
.tgk-front-admin .tgk-rich-editor-wrap .wp-editor-container {
    max-width: 100%;
}

.tgk-rules-content ul,
.tgk-rules-content ol {
    margin-left: 1.4rem;
}

.tgk-rules-content li {
    margin: 0.25rem 0;
}

.tgk-rules-content p {
    margin: 0 0 0.75rem;
}

.tgk-rules-content p:last-child {
    margin-bottom: 0;
}
