/* Anketo — Public respondent form + marketing landing */

/* ---- Public form shell ----------------------------------------------------*/
.ak-public-body {
    background:
        radial-gradient(1100px 480px at 50% -8%, var(--ak-bg-accent), transparent 70%),
        var(--ak-bg);
    min-height: 100vh;
}
.ak-public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 0;
}
.ak-form-card {
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-xl);
    box-shadow: var(--ak-shadow-lg);
    overflow: hidden;
    background: var(--ak-surface);
}
.ak-form-accent { height: 6px; background: linear-gradient(90deg, var(--ak-primary), #8b5cf6); }
.ak-form-head { padding: 1.75rem 1.9rem .25rem; }
.ak-form-title { font-size: 1.6rem; margin-bottom: .5rem; }
.ak-form-desc { color: var(--ak-text-muted); }
.ak-form-body { padding: 1.25rem 1.9rem 1.9rem; }
/* Wrap long unbroken content (emails, URLs, account numbers). word-break stays
   normal so lines break at spaces; only a token too wide for the line is split. */
.ak-form-head,
.ak-form-body {
    overflow-wrap: break-word;
    word-break: normal;
}
.ak-form-body .mb-3 { margin-bottom: 1.25rem !important; }
.ak-public-footer { color: var(--ak-text-muted); font-size: .82rem; }

@media (max-width: 575.98px) {
    .ak-form-head { padding: 1.35rem 1.15rem .25rem; }
    .ak-form-body { padding: 1rem 1.15rem 1.5rem; }
    .ak-form-title { font-size: 1.35rem; }
    .ak-public-topbar { padding: .85rem 0; }
}

/* Conditionally-hidden fields */
.ak-field[hidden] { display: none !important; }

/* Address field */
.ak-address-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.05rem 1.5rem;
}
.ak-address-full {
    grid-column: 1 / -1;
}
.ak-address-grid .form-text {
    display: block;
    margin-top: .45rem;
    color: var(--ak-text);
    font-size: .86rem;
}

@media (max-width: 575.98px) {
    .ak-address-grid {
        grid-template-columns: 1fr;
        gap: .9rem;
    }
}

/* Page breaks */
.ak-page-step {
    padding-bottom: .85rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--ak-border);
}
.ak-page-step span {
    display: block;
    color: var(--ak-text-muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .25rem;
}
.ak-page-step h2 {
    font-size: 1.15rem;
    margin: 0;
}
.ak-page-actions {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.5rem;
}
.ak-page-actions [data-ak-page-submit],
.ak-page-actions [data-ak-page-next] {
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .ak-page-actions {
        flex-direction: column-reverse;
    }
    .ak-page-actions .btn {
        width: 100%;
    }
}

/* Rich-text paragraph body (Quill output) */
.ak-paragraph-body :where(p, ul, ol, blockquote, h1, h2, h3, h4, h5, h6):last-child { margin-bottom: 0; }
.ak-paragraph-body .ql-align-center { text-align: center; }
.ak-paragraph-body .ql-align-right { text-align: right; }
.ak-paragraph-body .ql-align-justify { text-align: justify; }
.ak-paragraph-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ak-radius-sm);
    margin: .35rem 0;
}

/* Review before submit */
.ak-review-before-submit {
    padding: 1rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    background: var(--ak-surface-2);
}
.ak-review-before-submit h3 {
    font-size: 1.05rem;
}
.ak-review-list {
    display: grid;
    gap: .65rem;
}
.ak-review-row {
    display: grid;
    grid-template-columns: minmax(7rem, 34%) minmax(0, 1fr);
    gap: .85rem;
    padding-bottom: .65rem;
    border-bottom: 1px solid var(--ak-border);
}
.ak-review-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}
.ak-review-row dt {
    color: var(--ak-text-muted);
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}
.ak-review-row dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 575.98px) {
    .ak-review-row {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
}

/* Appointment field → date + tappable time slots */
.ak-appt-slots:empty { display: none; }
.ak-appt-slot { min-width: 4.5rem; }
.ak-appt-slot.ak-appt-booked {
    text-decoration: line-through;
    opacity: .5;
    cursor: not-allowed;
}

/* Choice fields → tappable option cards (no markup change; styles .form-check) */
.ak-form-body .form-check {
    position: relative;
    padding: .7rem .8rem .7rem 2.6rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm);
    margin-bottom: .5rem;
    transition: border-color .12s ease, background-color .12s ease;
    min-height: auto;
}
.ak-form-body .form-check:hover { border-color: var(--ak-border-strong); background: var(--ak-surface-hover); }
.ak-form-body .form-check .form-check-input { margin-left: -1.8rem; margin-top: .15rem; }
.ak-form-body .form-check:has(.form-check-input:checked) {
    border-color: var(--ak-primary);
    background: var(--ak-primary-subtle);
}
.ak-form-body .form-check-label { cursor: pointer; font-weight: 500; display: block; }

/* Product list field */
.ak-product-items {
    display: flex;
    flex-direction: column;
}
.ak-product-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1.2rem 0 1.45rem;
    border-bottom: 1px solid var(--ak-border);
}
.ak-product-item.has-image {
    grid-template-columns: 24px 72px minmax(0, 1fr) auto;
}
.ak-product-item.is-disabled {
    opacity: .62;
}
.ak-product-check {
    align-self: center;
    margin: 0;
}
.ak-product-media {
    width: 72px;
    aspect-ratio: 1;
    border-radius: .25rem;
    overflow: hidden;
    background: #8fb0d2;
}
.ak-product-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ak-product-main {
    min-width: 0;
}
.ak-product-name {
    display: block;
    font-weight: 700;
    cursor: pointer;
}
.ak-product-desc {
    margin: .2rem 0 0;
    color: var(--ak-text-muted);
    font-size: .9rem;
}
.ak-product-price {
    flex-shrink: 0;
    font-weight: 700;
    align-self: start;
    padding-top: .15rem;
    white-space: nowrap;
}
.ak-product-controls {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-top: .6rem;
}
.ak-product-controls .ak-product-qty.form-select {
    flex: 0 0 4.4rem;
    width: 4.4rem;
    min-width: 4.4rem;
    max-width: 4.4rem;
    padding-left: .65rem;
    padding-right: 1.65rem;
}
.ak-product-qty-label,
.ak-product-stock {
    color: var(--ak-text-muted);
    font-size: .85rem;
    font-weight: 600;
}
.ak-product-total {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 2.25rem;
    align-items: center;
    margin-top: 1.6rem;
    padding-top: 1.15rem;
    border-top: 1px solid var(--ak-border);
}
.ak-product-total span {
    grid-column: 2;
    color: var(--ak-text-muted);
    font-weight: 700;
}
.ak-product-total strong {
    min-width: 5rem;
    text-align: right;
}

@media (max-width: 575.98px) {
    .ak-product-item {
        grid-template-columns: 22px minmax(0, 1fr) auto;
        gap: .7rem;
        padding: 1rem 0 1.2rem;
    }
    .ak-product-item.has-image {
        grid-template-columns: 22px 56px minmax(0, 1fr) auto;
    }
    .ak-product-media {
        width: 56px;
    }
    .ak-product-price {
        grid-column: 3;
        grid-row: 1;
        font-size: .95rem;
    }
    .ak-product-item.has-image .ak-product-price { grid-column: 4; grid-row: 1; }
    .ak-product-item.has-image .ak-product-main { grid-column: 3; }
    .ak-product-controls { gap: .45rem; }
    .ak-product-controls .ak-product-qty.form-select {
        flex-basis: 4rem;
        width: 4rem;
        min-width: 4rem;
        max-width: 4rem;
    }
    .ak-product-total { grid-template-columns: 1fr auto auto; gap: 1rem; }
}

/* ---- Success state --------------------------------------------------------*/
.ak-success { text-align: center; padding: 3rem 1.9rem; }
.ak-success-badge {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #fff;
    background: linear-gradient(135deg, var(--ak-success), #059669);
    box-shadow: 0 10px 26px rgba(var(--ak-success-rgb), .4);
    margin-bottom: 1.25rem;
    animation: ak-pop .45s cubic-bezier(.2, .9, .3, 1.4) both;
}
@keyframes ak-pop {
    0% { transform: scale(.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ---- Landing / marketing --------------------------------------------------*/
.ak-hero {
    position: relative;
    padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4.5rem);
    text-align: center;
    overflow: hidden;
}
.ak-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(760px 380px at 50% -12%, var(--ak-bg-accent), transparent 72%);
    z-index: -1;
}
.ak-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--ak-primary-subtle-text);
    background: var(--ak-primary-subtle);
    border: 1px solid rgba(var(--ak-primary-rgb), .28);
    padding: .35rem .8rem;
    border-radius: 999px;
    margin-bottom: 1.4rem;
}
.ak-hero h1 {
    font-size: clamp(2.1rem, 5.5vw, 3.5rem);
    line-height: 1.07;
    margin-bottom: 1.1rem;
    letter-spacing: -0.035em;
}
.ak-hero .ak-hero-accent {
    background: linear-gradient(120deg, var(--ak-primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ak-hero-lead {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--ak-text-muted);
    max-width: 40rem;
    margin: 0 auto 2rem;
}
.ak-hero-cta { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

.ak-feature {
    height: 100%;
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-lg);
    padding: 1.6rem;
    box-shadow: var(--ak-shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ak-feature:hover { transform: translateY(-3px); box-shadow: var(--ak-shadow-md); border-color: var(--ak-border-strong); }
.ak-feature h3 { font-size: 1.1rem; margin: 1rem 0 .5rem; }
.ak-feature p { color: var(--ak-text-muted); margin: 0; font-size: .95rem; }

/* Product mock preview under the hero */
.ak-mock {
    background: var(--ak-surface);
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-xl);
    box-shadow: var(--ak-shadow-lg);
    overflow: hidden;
    max-width: 60rem;
    margin: 3rem auto 0;
}
.ak-mock-bar {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--ak-border);
    background: var(--ak-surface-2);
}
.ak-mock-dot { width: .7rem; height: .7rem; border-radius: 999px; background: var(--ak-border-strong); }
.ak-mock-body { padding: 1.5rem; }
.ak-skel { background: var(--ak-surface-2); border-radius: .5rem; }

.ak-landing-footer {
    border-top: 1px solid var(--ak-border);
    color: var(--ak-text-muted);
    padding: 2rem 0;
    margin-top: 3.5rem;
}
