/* ============================================================
   Terapeuci Opinie – formularz wystawienia opinii
   NeuroExpert brand · noomedica.pl
   ============================================================ */

/* ── Wrapper strony ─────────────────────────────────────────── */
.to-form-page {
    width: 100%;
    padding: 0 0 48px;
    font-family: 'Para', Inter, system-ui, -apple-system, sans-serif;
    color: #475569;
}

/* ── Dwukolumnowy layout (desktop) ──────────────────────────── */
.to-form-layout {
    display: flex;
    gap: 64px;
    align-items: flex-start;
    width: 100%;
}

/* Lewa kolumna: wprowadzenie */
.to-form-intro {
    flex: 0 0 380px;
    max-width: 420px;
    position: sticky;
    top: 40px;
}

/* Prawa kolumna: formularz */
.to-form-main {
    flex: 1 1 0;
    min-width: 0;
}

/* ── Eyebrow label ──────────────────────────────────────────── */
.to-form-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #1577af;
    margin: 0 0 12px;
}

/* ── Nagłówek ───────────────────────────────────────────────── */
.to-form-heading {
    font-family: 'Title', Merriweather, Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    line-height: 1.2;
}

/* ── Lead ───────────────────────────────────────────────────── */
.to-form-lead {
    font-size: 15px;
    line-height: 1.75;
    color: #64748b;
    margin: 0 0 28px;
}

/* ── Alert (sukces / błąd) ──────────────────────────────────── */
.to-form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.to-form-alert--error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.to-form-alert--success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

/* ── Karta formularza ───────────────────────────────────────── */
.to-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 32px 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
}

/* ── Pola formularza ────────────────────────────────────────── */
.to-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.to-field:last-child {
    margin-bottom: 0;
}

.to-field__label {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 3px;
}

.to-field__required {
    color: #1577af;
    font-weight: 700;
}

.to-field__hint {
    margin: 0;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.5;
}

.to-field__required-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: #94a3b8;
}

/* ── Inputs i textarea ──────────────────────────────────────── */
.to-form-page .to-input,
.to-form-page .to-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    font-family: 'Para', Inter, system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
    appearance: none;
    box-shadow: none !important;
}

.to-form-page .to-input::placeholder,
.to-form-page .to-textarea::placeholder {
    color: #cbd5e1;
}

.to-form-page .to-input:hover,
.to-form-page .to-textarea:hover {
    border-color: #cbd5e1 !important;
    background: #ffffff !important;
}

.to-form-page .to-input:focus,
.to-form-page .to-textarea:focus {
    border-color: #1577af !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(21, 119, 175, .12) !important;
}

.to-textarea {
    resize: vertical;
    min-height: 130px;
    line-height: 1.65;
}

/* Licznik znaków */
.to-textarea-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.to-char-count {
    font-size: 12px;
    color: #94a3b8;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.to-char-count--low {
    color: #f59e0b;
    font-weight: 600;
}

/* ── Gwiazdki ───────────────────────────────────────────────── */
.to-stars-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Gwiazdki w odwrotnej kolejności (CSS trick: hover na sibling) */
.to-stars {
    display: flex;
    flex-direction: row-reverse;
    gap: 6px;
    width: fit-content;
}

.to-star-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.to-star-label {
    display: flex;
    cursor: pointer;
    color: #e2e8f0;
    transition: color .12s ease, transform .1s ease;
}

.to-star-label svg {
    width: 38px;
    height: 38px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: .5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Gwiazdki zaznaczone i hover */
.to-stars .to-star-label:hover,
.to-stars .to-star-label:hover ~ .to-star-label,
.to-stars .to-star-input:checked ~ .to-star-label {
    color: #f59e0b;
}

.to-stars .to-star-label:hover {
    transform: scale(1.15);
}

/* Focus visible dla klawiatury */
.to-stars .to-star-input:focus-visible + .to-star-label {
    outline: 2px solid #1577af;
    outline-offset: 3px;
    border-radius: 4px;
}

/* Etykieta tekstowa oceny */
.to-stars-desc {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1577af;
    min-height: 1.4em;
    letter-spacing: .01em;
}

/* ── Checkbox ───────────────────────────────────────────────── */
.to-field--check {
    gap: 0;
}

.to-check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.to-check-box {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.to-check-box input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.to-check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    transition: border-color .15s, background .15s;
    pointer-events: none;
}

.to-check-icon svg {
    width: 12px;
    height: 10px;
    stroke: #ffffff;
    opacity: 0;
    transition: opacity .12s;
}

/* Zaznaczony */
.to-check-box input:checked + .to-check-icon {
    background: #1577af;
    border-color: #1577af;
}

.to-check-box input:checked + .to-check-icon svg {
    opacity: 1;
}

/* Hover */
.to-check-label:hover .to-check-icon {
    border-color: #1577af;
}

/* Focus */
.to-check-box input:focus-visible + .to-check-icon {
    outline: 2px solid #1577af;
    outline-offset: 2px;
}

.to-check-text {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
}

/* ── Przycisk submit ────────────────────────────────────────── */
.to-form-page .to-field--submit {
    margin-top: 8px;
    gap: 0;
}

.to-form-page .to-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: #1577af !important;
    color: #ffffff !important;
    font-family: 'Para', Inter, system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(21, 119, 175, .22) !important;
    transition: background .18s ease, box-shadow .18s ease, color .18s ease;
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-decoration: none !important;
}

.to-form-page .to-btn-primary:hover,
.to-form-page .to-btn-primary:focus {
    background: #11618e !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(21, 119, 175, .32) !important;
    border-color: transparent !important;
}

.to-form-page .to-btn-primary:active {
    background: #0e5278 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(21, 119, 175, .2) !important;
}

.to-form-page .to-btn-primary:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.to-form-page .to-btn-icon {
    width: 18px;
    height: 18px;
    stroke: #ffffff;
    flex-shrink: 0;
    transition: transform .18s ease;
}

.to-form-page .to-btn-primary:hover .to-btn-icon {
    transform: translateX(3px);
}

.to-form-page .to-btn-primary.to-btn--loading .to-btn-icon {
    display: none;
}

/* Spinner */
.to-form-page .to-btn-spinner {
    display: none;
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: to-spin .7s linear infinite;
    flex-shrink: 0;
}

.to-form-page .to-btn--loading .to-btn-spinner {
    display: block;
}

@keyframes to-spin {
    to { transform: rotate(360deg); }
}

/* ── Info o moderacji (w lewej kolumnie) ────────────────────── */
.to-form-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 0;
    padding: 14px 18px;
    background: #eaf4fa;
    border: 1px solid rgba(21, 119, 175, .15);
    border-radius: 10px;
}

.to-form-info svg {
    width: 18px;
    height: 18px;
    stroke: #1577af;
    flex-shrink: 0;
    margin-top: 1px;
}

.to-form-info p {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #1577af;
}

/* ── Ekran sukcesu ──────────────────────────────────────────── */
.to-success-wrap {
    text-align: center;
    padding: 48px 24px;
}

.to-success-icon {
    width: 64px;
    height: 64px;
    background: #ecfdf5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.to-success-icon svg {
    width: 30px;
    height: 30px;
    stroke: #047857;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.to-success-title {
    font-family: 'Title', Merriweather, Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
}

.to-success-text {
    font-size: 15px;
    color: #64748b;
    line-height: 1.7;
    margin: 0;
    max-width: 420px;
    margin: 0 auto;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Tablet: kolumny pionowo */
@media (max-width: 900px) {
    .to-form-layout {
        flex-direction: column;
        gap: 32px;
    }

    .to-form-intro {
        flex: none;
        max-width: 100%;
        position: static;
    }

    .to-form-main {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .to-form-page {
        padding: 0 0 32px;
    }

    .to-form-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .to-star-label svg {
        width: 32px;
        height: 32px;
    }

    .to-stars {
        gap: 4px;
    }
}
