/* IKM Public Survey — mobile-app shell (Bootstrap 5) */
:root {
    --ikm-primary: #667eea;
    --ikm-secondary: #764ba2;
    --ikm-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ikm-surface: #ffffff;
    --ikm-muted: #6c757d;
    --ikm-border: #e8eaf0;
    --ikm-radius: 18px;
    --ikm-radius-sm: 12px;
    --ikm-touch: 48px;
    --ikm-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ikm-cta-h: calc(72px + var(--ikm-safe-bottom));
}

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

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

body.ikm-app {
    background: var(--ikm-gradient);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
    padding: 0;
    padding-bottom: calc(var(--ikm-cta-h) + 12px);
}

body.ikm-app.ikm-no-cta {
    padding-bottom: calc(24px + var(--ikm-safe-bottom));
}

/* —— App shell —— */
.ikm-shell {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 12px 16px;
}

@media (min-width: 768px) {
    .ikm-shell {
        padding: 24px 16px 32px;
        max-width: 860px;
    }
    body.ikm-app {
        padding-bottom: 40px;
    }
}

/* —— Top bar —— */
.ikm-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: transparent;
}

.ikm-topbar .btn-back {
    width: var(--ikm-touch);
    height: var(--ikm-touch);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    color: var(--ikm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    flex-shrink: 0;
}

.ikm-topbar .btn-back:hover,
.ikm-topbar .btn-back:focus {
    background: #fff;
    color: var(--ikm-secondary);
}

.ikm-topbar-title {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* —— Landing hero —— */
.ikm-hero {
    text-align: center;
    color: #fff;
    padding: 28px 8px 20px;
}

.ikm-hero-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    font-size: 1.75rem;
    margin-bottom: 14px;
}

.ikm-hero h1 {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.ikm-hero .lead {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

@media (min-width: 768px) {
    .ikm-hero h1 {
        font-size: 1.85rem;
    }
}

/* —— Cards / sheets —— */
.ikm-card {
    background: var(--ikm-surface);
    border-radius: var(--ikm-radius);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    margin-bottom: 14px;
}

.ikm-card-header {
    background: var(--ikm-gradient);
    color: #fff;
    padding: 22px 20px;
    text-align: center;
}

.ikm-card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.35;
}

.ikm-card-header h3,
.ikm-card-header .ikm-role-label {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 8px;
    opacity: 0.95;
}

.ikm-card-header .ikm-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
}

.ikm-card-body {
    padding: 20px 16px;
}

@media (min-width: 768px) {
    .ikm-card-body {
        padding: 28px 28px;
    }
    .ikm-card-header {
        padding: 28px 32px;
    }
    .ikm-card-header h2 {
        font-size: 1.45rem;
    }
}

.ikm-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ikm-section-title i {
    color: var(--ikm-primary);
}

/* —— Form controls (touch-friendly) —— */
.ikm-app .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #374151;
}

.ikm-app .form-control,
.ikm-app .form-select {
    min-height: var(--ikm-touch);
    border-radius: var(--ikm-radius-sm);
    border-color: var(--ikm-border);
    padding: 0.7rem 0.95rem;
    font-size: 1rem;
}

.ikm-app textarea.form-control {
    min-height: auto;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.ikm-app .form-control:focus {
    border-color: var(--ikm-primary);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.2);
}

.ikm-app .form-control-lg,
.ikm-app .form-select-lg {
    min-height: 52px;
    font-size: 1.05rem;
}

.required-mark {
    color: #dc3545;
    font-weight: 700;
}

.ikm-hint {
    font-size: 0.8rem;
    color: var(--ikm-muted);
    margin-top: 4px;
}

/* —— Category & questions —— */
.kategori-section {
    background: #f6f7fb;
    padding: 14px;
    border-radius: var(--ikm-radius-sm);
    margin-bottom: 0;
}

.kategori-title {
    color: var(--ikm-primary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.35);
}

.pertanyaan-card {
    background: #fff;
    padding: 16px;
    border-radius: var(--ikm-radius-sm);
    margin-bottom: 12px;
    border: 1px solid var(--ikm-border);
    border-left: 4px solid var(--ikm-primary);
}

.pertanyaan-card:last-child {
    margin-bottom: 0;
}

.pertanyaan-number {
    background: var(--ikm-gradient);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 10px;
    flex-shrink: 0;
}

.pertanyaan-text {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 12px;
}

/* —— Option radios (large tap) —— */
.opsi-radio {
    padding: 14px 14px;
    border: 2px solid var(--ikm-border);
    border-radius: var(--ikm-radius-sm);
    margin-bottom: 10px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
    min-height: var(--ikm-touch);
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
}

.opsi-radio:active,
.opsi-radio:hover {
    border-color: var(--ikm-primary);
    background: #f8f9ff;
}

.opsi-radio:has(input:checked) {
    border-color: var(--ikm-primary);
    background: rgba(102, 126, 234, 0.08);
}

.opsi-radio input[type="radio"] {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    accent-color: var(--ikm-primary);
}

.opsi-radio input[type="radio"]:checked + label {
    font-weight: 700;
    color: var(--ikm-primary);
}

.opsi-radio label {
    cursor: pointer;
    margin-bottom: 0;
    line-height: 1.35;
}

/* —— Rating —— */
.rating-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: space-between;
}

.rating-option {
    flex: 1;
    text-align: center;
    padding: 0;
    border: 2px solid var(--ikm-border);
    border-radius: var(--ikm-radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    min-height: var(--ikm-touch);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.rating-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: var(--ikm-touch);
    margin: 0;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
}

.rating-option:hover {
    border-color: var(--ikm-primary);
}

.rating-option:has(input:checked),
.rating-option input[type="radio"]:checked + label {
    background: var(--ikm-gradient);
    color: #fff;
    border-color: transparent;
}

.rating-option:has(input:checked) {
    border-color: var(--ikm-primary);
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--ikm-muted);
}

/* —— Map / lokasi —— */
.ikm-map-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.ikm-map-actions .btn {
    min-height: var(--ikm-touch);
    border-radius: var(--ikm-radius-sm);
    font-weight: 600;
    width: 100%;
}

@media (min-width: 576px) {
    .ikm-map-actions {
        flex-direction: row;
    }
    .ikm-map-actions .btn {
        width: auto;
        flex: 1;
    }
}

#ikm_map {
    height: 280px;
    width: 100%;
    border-radius: var(--ikm-radius-sm);
    border: 2px solid var(--ikm-border);
    z-index: 1;
}

@media (min-width: 768px) {
    #ikm_map {
        height: 320px;
    }
}

.ikm-coord-pill {
    display: inline-block;
    background: rgba(40, 167, 69, 0.1);
    color: #198754;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    margin-top: 8px;
}

.ikm-media-preview img {
    max-height: 140px;
    max-width: 100%;
    border-radius: var(--ikm-radius-sm);
    object-fit: cover;
}

.ikm-foto-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ikm-foto-item {
    position: relative;
    border-radius: var(--ikm-radius-sm);
    overflow: hidden;
    background: #f1f3f5;
    aspect-ratio: 4 / 3;
}

.ikm-foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ikm-foto-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.ikm-foto-badge {
    position: absolute;
    left: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
}

.ikm-foto-actions .btn:disabled {
    opacity: 0.55;
}

/* —— Sticky bottom CTA —— */
.ikm-cta-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.1);
    padding: 12px 16px calc(12px + var(--ikm-safe-bottom));
}

.ikm-cta-inner {
    max-width: 720px;
    margin: 0 auto;
}

.btn-ikm-submit {
    background: var(--ikm-gradient);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    min-height: 52px;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.btn-ikm-submit:hover,
.btn-ikm-submit:focus {
    color: #fff;
    filter: brightness(1.05);
    box-shadow: 0 8px 22px rgba(102, 126, 234, 0.5);
}

.btn-ikm-submit:active {
    transform: scale(0.98);
}

.ikm-cta-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--ikm-muted);
    margin: 8px 0 0;
}

@media (min-width: 768px) {
    .ikm-cta-bar {
        position: static;
        background: #fff;
        backdrop-filter: none;
        border: none;
        border-radius: var(--ikm-radius);
        box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
        padding: 24px 28px;
        margin-top: 4px;
        margin-bottom: 14px;
    }
    .btn-ikm-submit {
        max-width: 360px;
        margin: 0 auto;
        display: block;
    }
    .ikm-cta-note {
        font-size: 0.85rem;
        margin-top: 12px;
    }
    body.ikm-app {
        padding-bottom: 40px;
    }
}

/* —— Role cards (landing) —— */
.responden-card {
    border: 2px solid var(--ikm-border);
    border-radius: var(--ikm-radius);
    padding: 18px 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    background: #fff;
    min-height: 88px;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
    .responden-card {
        margin: 0 6px 12px;
        height: calc(100% - 12px);
    }
}

.responden-card:hover,
.responden-card:focus {
    border-color: var(--ikm-primary);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.18);
    color: inherit;
    text-decoration: none;
}

.responden-card:active {
    transform: scale(0.98);
}

.responden-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(102, 126, 234, 0.12);
    color: var(--ikm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.responden-card-body {
    flex: 1;
    min-width: 0;
}

.responden-card-body h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.responden-card .badge-target {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 8px;
}

.responden-card .progress {
    height: 6px;
    border-radius: 999px;
    background: #eef0f6;
    margin-top: 8px;
}

.responden-chevron {
    color: var(--ikm-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.pick-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: #374151;
}

/* —— Empty / result —— */
.empty-state {
    text-align: center;
    padding: 48px 16px;
    color: var(--ikm-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 12px;
    opacity: 0.35;
}

.ikm-result-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    padding-bottom: calc(24px + var(--ikm-safe-bottom));
}

.ikm-result-card {
    background: #fff;
    border-radius: var(--ikm-radius);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.16);
    padding: 40px 24px;
    text-align: center;
    width: 100%;
    max-width: 420px;
}

.ikm-result-card .icon-success {
    font-size: 4rem;
    color: #28a745;
    margin-bottom: 12px;
}

.ikm-result-card .icon-error {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 12px;
}

.ikm-result-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.btn-ikm-primary {
    background: var(--ikm-gradient);
    border: none;
    color: #fff;
    font-weight: 700;
    min-height: 52px;
    border-radius: 14px;
    padding: 0 28px;
    width: 100%;
}

.btn-ikm-primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

.ikm-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    padding: 16px 8px 8px;
}

.ikm-footer small {
    opacity: 0.85;
}

/* —— Utility: stack on mobile —— */
.ikm-stack > [class*="col-"] {
    margin-bottom: 0;
}
