/* ==========================================================================
   KROTAR — /opina (public review form)
   Standalone page reached only via QR code. Mobile-first, fast to load:
   no WebGL, no external widgets — reuses the same color/spacing/type
   tokens and .glass-card / .btn / .eyebrow / :focus-visible system already
   defined in ../../style.css so the identity reads as part of the same
   site, just a lighter, single-purpose page.
   ========================================================================== */

/* Same blue/cyan radial-glow technique used across the landing (see
   .ambient-glow in style.css), reproduced here as a fixed backdrop since
   this page has no positioned section wrapper to hang that class off of. */
.opina-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.opina-ambient::before,
.opina-ambient::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    mix-blend-mode: screen;
}

.opina-ambient::before {
    top: -12%;
    left: -18%;
    width: 70vw;
    height: 70vw;
    max-width: 560px;
    max-height: 560px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.4) 0%, rgba(0, 91, 255, 0.16) 45%, transparent 75%);
}

.opina-ambient::after {
    bottom: -16%;
    right: -16%;
    width: 65vw;
    height: 65vw;
    max-width: 520px;
    max-height: 520px;
    background: radial-gradient(circle, rgba(0, 174, 239, 0.38) 0%, rgba(0, 174, 239, 0.14) 45%, transparent 75%);
}

.opina-main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-7) var(--space-4);
    box-sizing: border-box;
}

.opina-wrap {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.opina-logo {
    margin-bottom: var(--space-5);
}

.opina-card {
    width: 100%;
    padding: var(--space-6) var(--space-5);
    text-align: left;
}

.opina-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.4rem, 6vw, 1.85rem);
    line-height: 1.28;
    color: var(--color-text);
    margin: var(--space-3) 0 var(--space-2) 0;
}

.opina-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-body);
    margin-bottom: var(--space-6);
}

/* ---------------------------------------------------------------------- */
/* Shared field layout                                                    */
/* ---------------------------------------------------------------------- */
.opina-field {
    margin-bottom: var(--space-5);
}

/* Turnstile renders its own themed iframe (data-theme="dark" on the
   widget handles that) — this only keeps it from ever overflowing the
   card on narrow viewports. */
.opina-turnstile-field #opinaTurnstile {
    max-width: 100%;
    overflow: hidden;
}

.opina-field>label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text-body);
    margin-bottom: 0.5rem;
}

.opina-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text-body);
    margin: 0 0 0.6rem 0;
    padding: 0;
    border: 0;
}

.opina-error-msg {
    display: none;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--color-error);
    width: 100%;
}

.opina-field.has-error .opina-error-msg,
.opina-rating-field.has-error .opina-error-msg,
.opina-consent.has-error .opina-error-msg {
    display: block;
}

.opina-field.has-error textarea {
    border-color: var(--color-error);
}

/* ---------------------------------------------------------------------- */
/* Star rating — native radios, visually hidden (.visually-hidden from
   style.css), styled entirely through the checked/hover sibling selectors
   below. row-reverse + ~ makes "select star 3" light up stars 1–3 while
   keeping normal 1→5 left-to-right reading order and full native radio
   keyboard behavior (arrow keys, Tab as a single group stop). */
/* ---------------------------------------------------------------------- */
.opina-rating-field {
    margin: 0 0 var(--space-5) 0;
    padding: 0;
    border: 0;
    /* Fieldsets default to a browser min-width based on their content
       (min-content), which can silently force overflow on narrow screens
       regardless of any width set elsewhere — this removes that floor. */
    min-width: 0;
}

.opina-star-row {
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
    gap: 0.3rem;
}

.opina-star-row label {
    font-size: 2.5rem;
    line-height: 1;
    padding: 0.15rem 0.25rem;
    color: var(--color-border-light);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) ease, transform var(--duration-fast) ease;
}

.opina-star-row input:checked~label,
.opina-star-row input:checked~label~label,
.opina-star-row label:hover,
.opina-star-row label:hover~label {
    color: var(--color-cyan-bright);
}

.opina-star-row label:active {
    transform: scale(0.92);
}

.opina-star-row input:focus-visible+label {
    outline: 2px solid var(--color-cyan);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------------------------------------------------------------------- */
/* Comment textarea + character counter                                   */
/* ---------------------------------------------------------------------- */
.opina-field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 130px;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    /* 16px minimum (never smaller): iOS Safari force-zooms the whole page
       on focus for any text input under 16px, which is what was reported
       as fields "jumping"/overlapping on iPhone — this isn't a visual
       change, it's the zoom-trigger threshold. */
    font-size: 1rem;
    color: var(--color-text);
    background: rgba(4, 8, 20, 0.35);
    border: 1px solid rgba(59, 130, 246, 0.16);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
    resize: vertical;
    box-sizing: border-box;
    transition: border-color var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.opina-field textarea::placeholder {
    color: var(--color-text-dim);
}

.opina-field textarea:focus-visible {
    outline: none;
    border-color: rgba(0, 174, 239, 0.55);
    background: rgba(4, 8, 20, 0.5);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(0, 145, 255, 0.14);
}

.opina-comment-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

.opina-comment-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-text-dim);
    font-variant-numeric: tabular-nums;
}

.opina-comment-count.is-warning {
    color: var(--color-error);
}

/* ---------------------------------------------------------------------- */
/* Privacy note — real instructional text, not de-emphasized "pending"
   content, so it uses --color-text-body (not --color-text-dim) to stay
   comfortably readable at 4.5:1+. */
/* ---------------------------------------------------------------------- */
.opina-privacy-note {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--color-text-body);
    margin: 0 0 var(--space-5) 0;
}

/* ---------------------------------------------------------------------- */
/* Consent checkbox                                                        */
/* ---------------------------------------------------------------------- */
.opina-consent {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: var(--space-6);
}

.opina-consent input[type="checkbox"] {
    margin-top: 0.2rem;
    width: 18px;
    height: 18px;
    accent-color: var(--color-cyan);
    flex-shrink: 0;
}

.opina-consent label {
    flex: 1;
    min-width: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--color-text-body);
}

/* ---------------------------------------------------------------------- */
/* Submit + status                                                        */
/* ---------------------------------------------------------------------- */
.opina-submit-row {
    margin-top: var(--space-2);
}

.opina-submit {
    width: 100%;
}

.opina-submit[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.opina-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: opinaSpin 0.7s linear infinite;
}

.opina-submit.is-loading .opina-spinner {
    display: inline-block;
}

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

.opina-status {
    margin: var(--space-3) 0 0 0;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2em;
}

.opina-status.is-error {
    color: var(--color-error);
}

/* ---------------------------------------------------------------------- */
/* Success state                                                           */
/* ---------------------------------------------------------------------- */
.opina-success {
    text-align: center;
    padding: var(--space-4) 0;
}

.opina-success svg {
    margin: 0 auto var(--space-4) auto;
    color: var(--color-success);
}

.opina-success-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.opina-success-text {
    font-size: 0.92rem;
    color: var(--color-text-body);
    line-height: 1.6;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (min-width: 560px) {
    .opina-card {
        padding: var(--space-7) var(--space-6);
    }

    .opina-star-row label {
        font-size: 2.7rem;
    }
}
