/* Nairobi Central SDA Church - Decision Card Stylesheet (100% Responsive & Accessible) */
:root {
    --ncsda-navy: #36556e;
    --ncsda-navy-dark: #253f54;
    --ncsda-navy-soft: #eef3f7;
    --ncsda-ink: #1e293b;
    --ncsda-muted: #4b5c6b;
    --ncsda-border: #cbd5e1;
    --ncsda-dotted: #6b7b8c;
    --ncsda-bg: #ecf1f5;
    --ncsda-danger: #b42318;
    --ncsda-danger-bg: #fef3f2;
    --ncsda-success: #067647;
    --ncsda-success-bg: #ecfdf3;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: radial-gradient(circle at top center, #f6f9fb 0%, var(--ncsda-bg) 100%);
    color: var(--ncsda-ink);
    line-height: 1.5;
    min-height: 100vh;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 100;
    background: var(--ncsda-navy-dark);
    color: #fff;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: 12px;
}

.page-shell {
    width: 100%;
    max-width: 740px;
    margin: 0 auto;
    padding: clamp(14px, 3vw, 28px) clamp(12px, 3vw, 20px) 40px;
}

.church-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 0 2px;
    font-size: 0.86rem;
    color: var(--ncsda-muted);
}

.church-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--ncsda-navy-dark);
}

.church-emblem {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ncsda-navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-links a {
    color: var(--ncsda-navy-dark);
    text-decoration: none;
    font-weight: 600;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 5px;
}

.topbar-links a:hover {
    text-decoration: underline;
    background: rgba(54, 85, 110, 0.08);
}

.decision-card {
    position: relative;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 18px 42px rgba(24, 44, 62, 0.10), 0 2px 8px rgba(24, 44, 62, 0.06);
    border: 1px solid #e2e8f0;
    padding: clamp(26px, 5vw, 46px) clamp(18px, 6vw, 56px) clamp(64px, 9vw, 76px);
    overflow: hidden;
}

.card-wave-corner {
    position: absolute;
    left: 0;
    bottom: 0;
    width: clamp(110px, 24vw, 175px);
    height: clamp(110px, 24vw, 175px);
    pointer-events: none;
    z-index: 0;
}

.card-inner {
    position: relative;
    z-index: 1;
}

.card-header {
    text-align: center;
    margin-bottom: clamp(22px, 4vw, 32px);
}

.card-church-subtitle {
    margin: 0 0 6px;
    font-size: clamp(0.68rem, 1.8vw, 0.78rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ncsda-muted);
    font-weight: 600;
}

.card-title {
    margin: 0;
    display: inline-block;
    font-size: clamp(1.75rem, 5vw, 2.35rem);
    font-weight: 700;
    color: var(--ncsda-navy);
    letter-spacing: 0.01em;
    padding-bottom: 4px;
    border-bottom: 2.5px solid var(--ncsda-navy);
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.94rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--ncsda-danger-bg);
    border-color: #fecdca;
    color: var(--ncsda-danger);
}

.alert-success {
    background: var(--ncsda-success-bg);
    border-color: #abefc6;
    color: var(--ncsda-success);
}

.alert ul {
    margin: 6px 0 0 18px;
    padding: 0;
}

.dotted-fields {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2.5vw, 20px);
    margin-bottom: clamp(22px, 4vw, 30px);
}

.field-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.field-line label {
    font-size: 1rem;
    color: #263442;
    white-space: nowrap;
    font-weight: 400;
}

.req-star {
    color: var(--ncsda-navy-dark);
    font-weight: 700;
    margin-left: 2px;
}

.dotted-input {
    flex: 1 1 240px;
    min-width: 0;
    width: 100%;
    border: none;
    border-bottom: 1.75px dotted var(--ncsda-dotted);
    background: transparent;
    padding: 8px 6px 5px;
    min-height: 40px;
    font-size: 16px; /* Prevents iOS Safari zoom on focus */
    font-family: inherit;
    color: var(--ncsda-ink);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px 4px 0 0;
}

.dotted-input:focus {
    outline: 2px solid transparent;
    border-bottom: 2px solid var(--ncsda-navy);
    background-color: #f4f8fb;
}

.dotted-input:focus-visible {
    outline: 2px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.dotted-input::placeholder {
    color: #7b8a97;
    font-size: 0.9rem;
}

.desire-section {
    margin-bottom: 22px;
}

.desire-heading {
    margin: 0 0 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #16222c;
}

.desire-list {
    list-style: none;
    margin: 0;
    padding: 0 0 0 clamp(8px, 4vw, 42px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.desire-item {
    display: flex;
    flex-direction: column;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    font-size: 1rem;
    color: #263442;
    user-select: none;
    min-height: 44px; /* Accessible tap target >= 44px */
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.checkbox-label:hover {
    background: #f5f8fb;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #495766;
    border-radius: 2px;
    background: #fff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    transition: all 0.15s ease;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--ncsda-navy);
    border-color: var(--ncsda-navy);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2.5px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.other-inline-wrap {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.other-inline-wrap .checkbox-label {
    flex: 0 0 auto;
    padding-right: 4px;
}

.other-line-input {
    flex: 1 1 220px;
    min-width: 180px;
}

.other-input-wrap {
    margin-left: clamp(20px, 5vw, 40px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.other-textarea {
    width: 100%;
    border: none;
    border-bottom: 1.75px dotted var(--ncsda-dotted);
    background: transparent;
    padding: 8px 6px 4px;
    font-size: 16px;
    font-family: inherit;
    color: var(--ncsda-ink);
    resize: vertical;
    min-height: 44px;
    line-height: 1.6;
    border-radius: 4px 4px 0 0;
}

.other-textarea:focus {
    outline: none;
    border-bottom: 2px solid var(--ncsda-navy);
    background-color: #f4f8fb;
}

.other-textarea:focus-visible {
    outline: 2px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.card-meta-strip {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed #d8e1e8;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.occasion-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.occasion-row label {
    font-size: 0.9rem;
    color: var(--ncsda-muted);
    font-weight: 500;
}

.select-compact {
    padding: 8px 12px;
    min-height: 44px;
    border: 1px solid var(--ncsda-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    color: var(--ncsda-ink);
    background: #fff;
    max-width: 100%;
}

.select-compact:focus-visible {
    outline: 2.5px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.86rem;
    color: var(--ncsda-muted);
    background: #f8fafc;
    border: 1px solid #e6edf3;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    min-height: 44px;
}

.consent-row input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--ncsda-navy);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.consent-row input[type="checkbox"]:focus-visible {
    outline: 2.5px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.card-actions {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--ncsda-navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 26px;
    min-height: 46px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.15s ease;
}

.btn-primary:hover {
    background: var(--ncsda-navy-dark);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.topbar-links a:focus-visible {
    outline: 2.5px solid var(--ncsda-navy-dark);
    outline-offset: 2px;
}

.btn-secondary {
    background: #fff;
    color: var(--ncsda-navy-dark);
    border: 1px solid var(--ncsda-border);
    border-radius: 6px;
    padding: 11px 18px;
    min-height: 44px;
    font-size: 0.94rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-secondary:hover {
    background: var(--ncsda-navy-soft);
}

/* Confirmation Receipt View */
.receipt-box {
    text-align: center;
    padding: 10px 0 8px;
}

.receipt-check {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--ncsda-navy-soft);
    color: var(--ncsda-navy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.receipt-ref {
    display: inline-block;
    background: var(--ncsda-navy-soft);
    color: var(--ncsda-navy-dark);
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    margin: 8px 0 18px;
}

.receipt-summary {
    text-align: left;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 18px auto 24px;
    max-width: 520px;
    font-size: 0.94rem;
}

.receipt-summary p {
    margin: 6px 0;
}

.verse-note {
    font-style: italic;
    color: var(--ncsda-muted);
    font-size: 0.9rem;
    margin: 10px 0 22px;
}

.page-footer {
    text-align: center;
    margin-top: 18px;
    font-size: 0.84rem;
    color: var(--ncsda-muted);
}

.page-footer a {
    color: var(--ncsda-navy-dark);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 8px;
    display: inline-block;
}

.page-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .field-line {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .dotted-input {
        flex: 1 1 auto;
    }

    .other-inline-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .other-line-input {
        min-width: 0;
        margin-left: 32px;
    }

    .occasion-row {
        flex-direction: column;
        align-items: stretch;
    }

    .card-actions {
        justify-content: stretch;
    }

    .card-actions .btn-primary {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body {
        background: #fff;
    }

    .church-topbar,
    .card-meta-strip,
    .card-actions,
    .page-footer,
    .no-print {
        display: none !important;
    }

    .page-shell {
        max-width: 100%;
        padding: 0;
    }

    .decision-card {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
}
