/* ============================================================
   FazeRP - formularz podania
   Ladowany po ui.css (nadpisuje globalne style form/input/label)
   ============================================================ */

.podanie-page .dokumenty-box.podanie {
    width: min(880px, 92vw);
    padding: 0 clamp(18px, 4vw, 40px) 40px;
    background: rgba(6, 11, 20, 0.86);
    border: 1px solid rgba(120, 170, 255, 0.14);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.podanie-page .dokumenty-container {
    width: 100%;
    min-height: 70vh;
    margin: clamp(28px, 5vw, 64px) auto 0;
    padding: 0 16px;
}

/* ---------- Naglowek formularza ---------- */
.form-head {
    width: 100%;
    text-align: center;
    padding: 34px 0 6px;
}

.form-eyebrow,
.choice-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: #69c9ff;
}

.form-eyebrow::before,
.choice-eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22e07a;
    box-shadow: 0 0 0 4px rgba(34, 224, 122, 0.12);
}

.form-head h1 {
    font-size: clamp(26px, 4.5vw, 40px);
    line-height: 1.15;
    margin: 0;
    letter-spacing: 0.5px;
}

.form-head .accent {
    background: linear-gradient(120deg, #0f87ff, #00d1ff 55%, #00ffae);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-head p {
    margin: 12px auto 0;
    max-width: 560px;
    width: auto;
    padding: 0;
    font-size: 0.94rem;
    line-height: 1.6;
    color: #96a7b9;
    text-align: center;
}

/* ---------- Pasek postepu wypelnienia ---------- */
.form-progress {
    position: sticky;
    top: 78px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 22px 0 26px;
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(9, 16, 28, 0.94);
    border: 1px solid rgba(120, 170, 255, 0.18);
}

.form-progress-track {
    position: relative;
    flex: 1;
    height: 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.form-progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f87ff, #00d1ff 60%, #22e07a);
    transition: width .35s ease;
}

.form-progress-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #9fb2c6;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.form-progress.is-complete .form-progress-text {
    color: #22e07a;
}

/* ---------- Siatka pol ---------- */
.podanie-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    width: 100%;
    counter-reset: application-field;
}

/* domyslnie pole zajmuje cala szerokosc; krotkie ida obok siebie */
.podanie-form > label,
.podanie-form > .field {
    grid-column: 1 / -1;
    display: block;
    margin: 0;
    padding: 16px 18px 16px 58px;
    position: relative;
    counter-increment: application-field;
    border-radius: 14px;
    background: rgba(11, 18, 30, 0.72);
    border: 1px solid rgba(120, 170, 255, 0.12);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: #dbe8ff;
    transition: border-color .25s ease, background-color .25s ease;
}

.podanie-form > label::before,
.podanie-form > .field::before {
    content: counter(application-field, decimal-leading-zero);
    position: absolute;
    top: 15px;
    left: 16px;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(105, 201, 255, 0.24);
    border-radius: 9px;
    background: rgba(15, 135, 255, 0.09);
    color: #69c9ff;
    font-size: 0.68rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.podanie-form > label.half {
    grid-column: span 1;
}

.podanie-form > label:focus-within,
.podanie-form > .field:focus-within {
    border-color: rgba(120, 170, 255, 0.4);
    background: rgba(14, 23, 38, 0.85);
}

.podanie-form > label.is-complete,
.podanie-form > .field.is-complete {
    border-color: rgba(34, 224, 122, 0.28);
}

.podanie-form > label.is-complete::before,
.podanie-form > .field.is-complete::before {
    color: #22e07a;
    border-color: rgba(34, 224, 122, 0.3);
    background: rgba(34, 224, 122, 0.08);
}

/* ---------- Kontrolki ---------- */
.podanie-form input[type="text"],
.podanie-form input[type="number"],
.podanie-form textarea {
    width: 100%;
    height: auto;
    margin-top: 10px;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.55;
    color: #eef5ff;
    background: rgba(3, 7, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.podanie-form textarea {
    min-height: 118px;
    max-height: 320px;
    resize: vertical;
}

.podanie-form input::placeholder,
.podanie-form textarea::placeholder {
    color: #5d6d7e;
    font-weight: 400;
}

.podanie-form input:focus,
.podanie-form textarea:focus {
    outline: none;
    border-color: var(--color-one);
    box-shadow: 0 0 0 3px rgba(0, 209, 255, 0.14);
    background: rgba(3, 7, 14, 0.95);
}

/* pole spelnia minimalna dlugosc */
.podanie-form input.filled,
.podanie-form textarea.filled {
    border-color: rgba(34, 224, 122, 0.45);
}

.required {
    color: #ff5f6d;
    font-weight: 700;
    margin-left: 4px;
}

/* ---------- Licznik znakow ---------- */
.counter {
    display: block;
    margin-top: 7px;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: right;
    color: #66788b;
    font-variant-numeric: tabular-nums;
}

.counter.ok {
    color: #22e07a;
}

/* ---------- Radio jako kafelki ---------- */
.podanie-form .radio-group {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.podanie-form .radio-inline {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 0 !important;
    padding: 11px 14px;
    border-radius: 10px;
    background: rgba(3, 7, 14, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease;
}

.podanie-form .radio-inline:hover {
    border-color: rgba(120, 170, 255, 0.4);
}

.podanie-form .radio-inline input[type="radio"] {
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    accent-color: var(--color-one);
    flex: 0 0 auto;
    cursor: pointer;
}

.podanie-form .radio-inline:has(input:checked) {
    border-color: var(--color-one);
    background: rgba(0, 132, 255, 0.14);
}

/* ---------- Przycisk wyslij ---------- */
.podanie-form .form-submit {
    grid-column: 1 / -1;
    width: 100%;
    margin: 12px 0 0;
    padding: 15px 20px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #f2f8ff;
    background: linear-gradient(120deg, #0f87ff, #0c5bff);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.podanie-form .form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(12, 91, 255, 0.35);
}

.podanie-form .form-submit:disabled {
    filter: grayscale(0.5);
    cursor: wait;
    transform: none;
}

.form-note {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 0.8rem;
    color: #8b9bad;
    text-align: center;
}

/* ---------- Baner "kup range" ---------- */
.rank-shop-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff;
    border: 1px solid rgba(0, 170, 255, 0.35);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.18), rgba(0, 120, 255, 0.38));
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rank-shop-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 170, 255, 0.28);
    border-color: rgba(0, 170, 255, 0.65);
}

.rank-shop-cta-wrapper {
    width: 100%;
    text-align: center;
    margin: 26px 0 0;
}

/* ---------- Ekran wyboru dla niezalogowanych ---------- */
#termsOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 5, 11, 0.94);
}

.choice-box {
    width: min(620px, 94vw);
    padding: 32px clamp(20px, 4vw, 38px);
    border-radius: 18px;
    background: rgba(8, 14, 24, 0.96);
    border: 1px solid rgba(120, 170, 255, 0.2);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.choice-box h2 {
    font-size: clamp(19px, 3vw, 24px);
    line-height: 1.35;
    color: #eaf3ff;
    margin: 0 0 8px;
}

.choice-box p.choice-sub {
    color: #93a4b6;
    font-size: 0.92rem;
    margin-bottom: 22px;
}

.choice-actions {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

#termsOverlay .choice-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid rgba(120, 170, 255, 0.2);
    background: rgba(13, 22, 36, 0.9);
    color: #e7f1ff;
    font-size: 0.98rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: transform .2s ease, border-color .2s ease, background-color .2s ease;
}

#termsOverlay .choice-btn small {
    font-size: 0.78rem;
    font-weight: 500;
    color: #8fa2b6;
}

#termsOverlay .choice-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(120, 170, 255, 0.5);
    background: rgba(18, 31, 50, 0.96);
}

#termsOverlay .choice-btn.primary {
    background: linear-gradient(120deg, #0f87ff, #0c5bff);
    border-color: transparent;
}

#termsOverlay .choice-btn.primary small {
    color: rgba(255, 255, 255, 0.82);
}

.choice-hint {
    margin-top: 18px;
    font-size: 0.82rem;
    color: #7c8da0;
}

/* ---------- Powiadomienie o wyslaniu ---------- */
#alertBox {
    position: fixed;
    top: 90px;
    right: 20px;
    max-width: 380px;
    width: calc(100% - 40px);
    padding: 14px 18px;
    background: rgba(9, 16, 28, 0.97);
    border: 1px solid rgba(34, 224, 122, 0.5);
    border-left: 4px solid #22e07a;
    color: #eaf3ff;
    font-size: 0.92rem;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    animation: alertIn .35s ease;
}

#alertBox .close-btn {
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
    line-height: 1;
    color: #8b9bad;
}

#alertBox .close-btn:hover {
    color: #fff;
}

@keyframes alertIn {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
    .podanie-form {
        grid-template-columns: 1fr;
    }

    .podanie-form > label.half {
        grid-column: 1 / -1;
    }

    .form-progress {
        top: 8px;
        gap: 10px;
        padding: 10px 12px;
    }

    .podanie-page .dokumenty-box.podanie {
        padding: 0 14px 30px;
        width: 100%;
        border-radius: 15px;
    }

    .podanie-page .dokumenty-container {
        padding: 0 8px;
        margin-top: 20px;
    }

    .podanie-form > label,
    .podanie-form > .field {
        padding: 14px 14px 14px 50px;
    }

    .podanie-form > label::before,
    .podanie-form > .field::before {
        top: 13px;
        left: 12px;
    }

    .podanie-form .radio-group {
        grid-template-columns: 1fr;
    }

    .choice-box {
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        padding: 26px 18px;
    }

    #alertBox {
        top: 12px;
        right: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-progress-fill,
    .podanie-form .form-submit,
    .choice-btn {
        transition: none;
    }

    #alertBox {
        animation: none;
    }
}
