/* Podania - Trial Support (dokumenty/podania.php) - tylko to, czego nie ma w site.css */

/* Pole z fokusem nie chowa sie pod przyklejonym paskiem "Wyslij" */
html {
    scroll-padding-bottom: 120px;
}

.page-podania .page-hero {
    padding-bottom: clamp(26px, 3.6vw, 44px);
}

.podania-status {
    margin: 0 auto 16px;
}

/* nad karta wyboru (niezalogowany) - ta sama szerokosc co karta */
.podania-status.is-gate {
    max-width: 640px;
}

/* lista bledow z walidacji na serwerze */
.podania-errors {
    margin: 6px 0 0;
    padding-left: 1.1em;
    color: var(--text-2);
}

.podania-errors li + li {
    margin-top: 2px;
}

/* ---------- Link do sklepu (ranga bez podania) ---------- */
.shop-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(var(--gold-rgb), 0.07);
    border: 1px solid rgba(var(--gold-rgb), 0.26);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    text-align: left;
    transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}

.shop-cta .i {
    width: 17px;
    height: 17px;
    color: var(--gold);
}

.shop-cta .i:last-child {
    width: 14px;
    height: 14px;
    color: var(--text-3);
    transition: transform .2s var(--ease), color .2s;
}

.shop-cta:hover {
    background: rgba(var(--gold-rgb), 0.13);
    border-color: rgba(var(--gold-rgb), 0.5);
    transform: translateY(-1px);
}

.shop-cta:hover .i:last-child {
    color: var(--gold);
    transform: translate(2px, -2px);
}

/* ---------- Niezalogowany: karta wyboru sposobu zlozenia podania ---------- */
.gate {
    --pad: clamp(22px, 4.4vw, 44px);
    max-width: 640px;
    margin: 0 auto clamp(56px, 8vw, 104px);
    overflow: hidden;
    isolation: isolate;
    text-align: center;
    border-radius: var(--r-xl);
    border-color: rgba(var(--accent-rgb), 0.18);
    background:
        radial-gradient(34rem 15rem at 50% -12%, rgba(var(--accent-rgb), 0.15), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
        var(--panel);
    box-shadow: var(--shadow), 0 40px 90px -50px rgba(var(--accent-rgb), 0.45);
}

.gate::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(150, 214, 240, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(150, 214, 240, 0.045) 1px, transparent 1px);
    background-size: 36px 36px;
    -webkit-mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 10%, transparent 80%);
    mask-image: radial-gradient(ellipse 70% 45% at 50% 0%, #000 10%, transparent 80%);
    pointer-events: none;
}

.gate-badge {
    gap: 7px;
    margin-bottom: 18px;
}

.gate-badge .dot {
    width: 6px;
    height: 6px;
    animation: gate-pulse 2.2s ease-in-out infinite;
}

@keyframes gate-pulse {
    50% { opacity: .35; }
}

.gate-title {
    font-size: clamp(23px, 2.7vw, 30px);
    letter-spacing: -0.015em;
}

.gate-sub {
    margin-top: 10px;
    color: var(--text-2);
    font-size: 14.5px;
}

.gate-options {
    display: grid;
    gap: 12px;
    margin: 28px 0 24px;
    text-align: left;
}

.gate-option {
    --c-rgb: var(--accent-rgb);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--line-2);
    transition: transform .25s var(--ease), border-color .25s, background-color .25s, box-shadow .25s;
}

.gate-option:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--c-rgb), 0.55);
    background: rgba(var(--c-rgb), 0.07);
}

.gate-option.is-primary {
    --c-rgb: 88, 101, 242;
    border-color: rgba(var(--c-rgb), 0.45);
    background: linear-gradient(135deg, rgba(var(--c-rgb), 0.2), rgba(var(--c-rgb), 0.06));
    box-shadow: 0 18px 40px -26px rgba(var(--c-rgb), 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gate-option.is-primary:hover {
    border-color: rgba(var(--c-rgb), 0.75);
    background: linear-gradient(135deg, rgba(var(--c-rgb), 0.27), rgba(var(--c-rgb), 0.09));
}

.gate-option-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: rgba(var(--c-rgb), 0.13);
    border: 1px solid rgba(var(--c-rgb), 0.3);
    color: rgb(var(--c-rgb));
}

.gate-option.is-primary .gate-option-icon {
    background: var(--discord);
    border-color: transparent;
    color: #fff;
}

.gate-option-icon .i {
    width: 22px;
    height: 22px;
}

.gate-option-body strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
}

.gate-option-body small {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text-2);
}

.gate-option-body small .i {
    width: 14px;
    height: 14px;
    color: rgb(var(--c-rgb));
}

.gate-option-arrow {
    width: 18px;
    height: 18px;
    color: var(--text-3);
    transition: transform .25s var(--ease), color .25s;
}

.gate-option:hover .gate-option-arrow {
    color: rgb(var(--c-rgb));
    transform: translate(3px, -3px);
}

.gate-hint {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-3);
}

.gate-hint a {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .gate-option {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .gate-option-arrow {
        display: none;
    }

    .gate-option-icon {
        width: 42px;
        height: 42px;
    }
}

/* ---------- Podziekowanie po wyslaniu ---------- */
.state-card {
    --pad: clamp(28px, 5vw, 52px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto clamp(56px, 8vw, 104px);
    text-align: center;
    border-radius: var(--r-xl);
    border-color: rgba(var(--c-rgb), 0.3);
    background:
        radial-gradient(30rem 14rem at 50% -10%, rgba(var(--c-rgb), 0.16), transparent 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
        var(--panel);
}

.state-icon {
    width: 68px;
    height: 68px;
    margin-bottom: 8px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(var(--c-rgb), 0.13);
    border: 1px solid rgba(var(--c-rgb), 0.4);
    color: rgb(var(--c-rgb));
    box-shadow: 0 0 0 9px rgba(var(--c-rgb), 0.05), 0 0 48px rgba(var(--c-rgb), 0.3);
}

.state-icon .i {
    width: 32px;
    height: 32px;
}

.state-title {
    font-size: clamp(22px, 2.6vw, 28px);
}

.state-text {
    color: var(--text-2);
    font-size: 14.5px;
}

.state-text .i {
    margin-right: 7px;
    color: rgb(var(--c-rgb));
}

.state-card .cluster {
    justify-content: center;
    margin-top: 14px;
}

@media (max-width: 480px) {
    .state-card .cluster .btn {
        flex: 1 1 auto;
    }
}

/* ---------- Formularz ---------- */
.apply-card {
    --pad: clamp(18px, 3.4vw, 36px);
    margin-bottom: clamp(56px, 8vw, 104px);
    border-radius: var(--r-xl);
}

.apply-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.apply-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.apply-user .avatar {
    --size: 44px;
    border-color: rgba(var(--accent-rgb), 0.35);
}

.apply-user small {
    display: block;
    font-size: 12px;
    color: var(--text-3);
}

.apply-user strong {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    word-break: break-all;
}

.form-note {
    font-size: 12.5px;
    color: var(--text-3);
}

.form-note .req {
    color: var(--accent);
    font-weight: 600;
}

.podanie-form {
    counter-reset: pytanie;
    gap: 14px;
}

/* Kafelek pytania */
.q {
    padding: 18px 20px;
    border-radius: var(--r-lg);
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid var(--line);
    transition: border-color .25s, background-color .25s;
}

.q:focus-within {
    border-color: rgba(var(--accent-rgb), 0.32);
    background: rgba(var(--accent-rgb), 0.03);
}

.q.is-complete {
    border-color: rgba(var(--ok-rgb), 0.22);
}

.q.is-complete:focus-within {
    border-color: rgba(var(--ok-rgb), 0.38);
}

fieldset.q {
    display: block;
    margin: 0;
    min-width: 0;
}

fieldset.q > legend {
    float: left;
    width: 100%;
    padding: 0;
    margin: 0 0 12px;
}

fieldset.q .choice-group {
    clear: both;
}

.q .label {
    align-items: flex-start;
    gap: 12px;
    font-size: 14.5px;
    line-height: 1.5;
}

.q .label .req {
    color: var(--accent);
}

.q-num {
    flex: none;
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 22px;
    padding: 0 7px;
    border-radius: 7px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    font: 600 11.5px/1 var(--font-mono);
    color: var(--accent-hi);
    transition: background-color .25s, border-color .25s, color .25s;
}

.q-num::before {
    counter-increment: pytanie;
    content: counter(pytanie, decimal-leading-zero);
}

.q.is-complete .q-num {
    background: rgba(var(--ok-rgb), 0.14);
    border-color: rgba(var(--ok-rgb), 0.38);
    color: var(--ok);
}

.q .textarea {
    min-height: 124px;
    field-sizing: content;
    max-height: 520px;
}

.q .textarea-lg {
    min-height: 184px;
}

.q .input.filled,
.q .textarea.filled {
    border-color: rgba(var(--ok-rgb), 0.3);
}

.q .input:user-invalid:not(:focus),
.q .textarea:user-invalid:not(:focus) {
    border-color: rgba(var(--bad-rgb), 0.55);
}

.q .counter {
    margin-top: -2px;
    transition: color .2s;
}

.q .counter.ok {
    color: var(--ok);
}

.q .choice {
    min-height: 48px;
}

/* Przyklejony pasek: postep + wyslanie */
.submit-bar {
    position: sticky;
    bottom: 14px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 14px 22px;
    margin-top: 8px;
    padding: 12px 12px 12px 20px;
    border-radius: var(--r-lg);
    background: #09101a;
    border: 1px solid var(--line-2);
    box-shadow: 0 22px 50px -18px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.submit-progress {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.submit-progress-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
    transition: color .25s;
}

.submit-progress-text .i {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.progress-track {
    height: 6px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform .45s var(--ease);
}

.submit-bar.is-complete {
    border-color: rgba(var(--ok-rgb), 0.35);
}

.submit-bar.is-complete .progress-fill {
    background: linear-gradient(90deg, var(--teal), var(--ok));
}

.submit-bar.is-complete .submit-progress-text,
.submit-bar.is-complete .submit-progress-text .i {
    color: var(--ok);
}

.form-submit {
    flex: none;
    letter-spacing: 0.04em;
}

.btn.form-submit.is-sending {
    opacity: .75;
}

/* Przycisk "do gory" nie zaslania paska wysylania */
@media (max-width: 1000px) {
    .has-form .to-top {
        bottom: 100px;
    }
}

@media (max-width: 640px) {
    /* na telefonie bez ramki wokol formularza - wiecej miejsca na pola */
    .apply-card {
        --pad: 0;
        background: none;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .apply-head {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .q {
        padding: 16px;
    }

    .q .label {
        display: block;
    }

    .q-num {
        margin-right: 8px;
        vertical-align: 1px;
    }

    .submit-bar {
        bottom: 10px;
        gap: 14px;
        padding: 12px 12px 12px 16px;
    }

    .form-submit {
        --btn-h: 48px;
        padding: 0 18px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .submit-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* grupa wyboru z bledem walidacji (serwer) */
fieldset.q.has-error .choice {
    border-color: rgba(var(--bad-rgb), 0.55);
}
