:root {
    --green: #059669;
    --green-dark: #047857;
    --green-light: #10b981;
    --bg: #f0fdf4;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
}

.header-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-logo { width: 48px; height: 48px; flex-shrink: 0; }

.header-home-link { display: flex; align-items: center; gap: 1rem; text-decoration: none; }

.btn-back-home {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.5rem;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-back-home:hover { background: rgba(255,255,255,0.1); color: white; }

.header-inner h1 { font-size: 1.1rem; font-weight: 700; color: white; }
.header-inner p  { font-size: 0.78rem; color: rgba(255,255,255,0.65); }

/* ── Main ───────────────────────────────────────────────────────────────── */
.main-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.75rem 1rem 3rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card-section {
    background: var(--card);
    border-radius: 1.25rem;
    padding: 2rem 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.section-icon {
    width: 46px;
    height: 46px;
    background: rgba(5, 150, 105, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.card-section h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.3rem; }

.section-sub {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.55;
}

/* ── IC Search ──────────────────────────────────────────────────────────── */
.ic-search { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.ic-search input {
    flex: 1;
    min-width: 180px;
    border: 1.5px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ic-search input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
    background: white;
}

.btn-green {
    background: var(--green);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-green:hover   { background: var(--green-dark); transform: translateY(-1px); }
.btn-green:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Status Result Cards ────────────────────────────────────────────────── */
.status-card {
    margin-top: 1.25rem;
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1.5px solid;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.status-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sc-name    { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.2rem; }
.sc-label   { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; opacity: 0.8; }
.sc-message { font-size: 0.875rem; line-height: 1.6; }
.sc-pakej   { font-size: 0.78rem; margin-top: 0.5rem; opacity: 0.75; }

/* Color variants */
.sc-staging   { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.sc-staging   .status-card-icon { background: #ffedd5; color: #ea580c; }

.sc-pending   { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.sc-pending   .status-card-icon { background: #fef3c7; color: #d97706; }

.sc-recorded  { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.sc-recorded  .status-card-icon { background: #dbeafe; color: #2563eb; }

.sc-otp       { background: #f5f3ff; border-color: #ddd6fe; color: #4c1d95; }
.sc-otp       .status-card-icon { background: #ede9fe; color: #7c3aed; }

.sc-official  { background: #ecfdf5; border-color: #a7f3d0; color: #064e3b; }
.sc-official  .status-card-icon { background: #d1fae5; color: #059669; }

.sc-notfound  { background: #f8fafc; border-color: var(--border); color: var(--muted); }
.sc-notfound  .status-card-icon { background: #f1f5f9; color: #94a3b8; }

.sc-error     { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.sc-error     .status-card-icon { background: #fee2e2; color: #dc2626; }

/* ── OR Divider ─────────────────────────────────────────────────────────── */
.or-divider {
    text-align: center;
    position: relative;
    margin: 0.25rem 0;
}
.or-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: #cbd5e1;
}
.or-divider span {
    position: relative;
    background: var(--bg);
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.12em;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.form-notice {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    font-size: 0.8rem;
    color: #1e40af;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

.field-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin: 1.25rem 0 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.field-section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.field-section-title.optional { color: #94a3b8; }
.field-section-title.optional span { font-weight: 400; text-transform: none; letter-spacing: 0; }
.req-icon { font-size: 0.45rem; color: #ef4444; vertical-align: super; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field.span-2 { grid-column: span 2; }

.field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

.field input,
.field select {
    border: 1.5px solid var(--border);
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(5,150,105,0.12);
    background: white;
}

.field input::placeholder { color: #cbd5e1; }
.req { color: #ef4444; }

.btn-submit {
    width: 100%;
    margin-top: 1.5rem;
    background: var(--green);
    color: white;
    border: none;
    border-radius: 0.875rem;
    padding: 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    transition: all 0.2s;
}

.btn-submit:hover   { background: var(--green-dark); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ── Jemaah (Family Members) Table ─────────────────────────────────────── */
.jemaah-table-wrap {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1.5px solid var(--border);
    margin-bottom: 0.75rem;
}

.jemaah-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.jemaah-table thead th {
    background: #f1f5f9;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1.5px solid var(--border);
    white-space: nowrap;
}

.jemaah-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border);
}

.jemaah-table td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.jemaah-table .col-bil {
    width: 2.5rem;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}

.jemaah-table .col-del { width: 2.5rem; }

.jemaah-table input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text);
    background: #f8fafc;
    transition: border-color 0.15s;
    min-width: 0;
}

.jemaah-table input:focus {
    outline: none;
    border-color: var(--green);
    background: white;
    box-shadow: 0 0 0 2px rgba(5,150,105,0.1);
}

.jemaah-table input::placeholder { color: #cbd5e1; }

.btn-del-row {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.btn-del-row:hover { color: #ef4444; background: #fee2e2; }

.jemaah-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    padding: 1rem;
    font-style: italic;
}

.btn-add-jemaah {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1.5px dashed var(--green-light);
    color: var(--green);
    border-radius: 0.625rem;
    padding: 0.55rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 1.25rem;
    transition: background 0.15s, border-color 0.15s;
}

.btn-add-jemaah:hover { background: #f0fdf4; border-style: solid; }

/* ── Surat Upload ───────────────────────────────────────────────────────── */
.surat-upload-wrap { margin-bottom: 1.25rem; }

.surat-upload-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.surat-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 1rem 0.75rem;
    border-radius: 0.75rem;
    border: 2px solid var(--border);
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.surat-option-btn:hover { border-color: var(--green); background: #f0fdf4; }

.surat-option-btn i { font-size: 1.6rem; }
.surat-option-btn span { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.surat-option-btn small { font-size: 0.72rem; color: var(--muted); }

.surat-camera-btn i { color: #0ea5e9; }
.surat-camera-btn:hover { border-color: #0ea5e9; background: #f0f9ff; }

.surat-gallery-btn i { color: var(--green); }

.surat-drop-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    padding: 1.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
    background: #f8fafc;
}
.surat-drop-area:hover, .surat-drop-area.drag-over {
    border-color: var(--green);
    background: #f0fdf4;
}
.surat-icon { font-size: 2rem; color: var(--muted); margin-bottom: 0.25rem; }
.surat-drop-area:hover .surat-icon, .surat-drop-area.drag-over .surat-icon { color: var(--green); }
.surat-drop-text { font-size: 0.875rem; color: var(--text); font-weight: 500; }
.surat-drop-hint { font-size: 0.75rem; color: var(--muted); }

.surat-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--green);
    border-radius: 0.75rem;
    background: #f0fdf4;
}
.surat-preview-icon { font-size: 1.5rem; color: var(--green); flex-shrink: 0; }
.surat-preview-info { flex: 1; min-width: 0; }
.surat-filename { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.surat-filesize { font-size: 0.75rem; color: var(--muted); }

/* ── Kategori Selection ─────────────────────────────────────────────────── */
.kategori-select-wrap {
    margin-bottom: 1.25rem;
}

.kategori-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.kategori-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.kategori-option { cursor: pointer; }
.kategori-option input[type="radio"] { display: none; }

.kategori-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.9rem 0.75rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    background: #f8fafc;
    text-align: center;
    transition: all 0.15s;
    cursor: pointer;
}

.kategori-card i { font-size: 1.3rem; color: var(--muted); }
.kategori-card strong { font-size: 0.9rem; color: var(--text); }
.kategori-card small { font-size: 0.72rem; color: var(--muted); }

.kategori-option input:checked + .kategori-card {
    border-color: var(--green);
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(5,150,105,0.1);
}
.kategori-option input:checked + .kategori-card i,
.kategori-option input:checked + .kategori-card strong { color: var(--green); }

/* ── Jemaah Kategori Select ─────────────────────────────────────────────── */
.jemaah-kategori-select {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text);
    background: #f8fafc;
    cursor: pointer;
    min-width: 90px;
}
.jemaah-kategori-select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(5,150,105,0.1);
}

/* ── Form Success ───────────────────────────────────────────────────────── */
.form-success {
    text-align: center;
    padding: 2.5rem 1rem;
    animation: fadeSlideIn 0.4s ease;
}

.form-success > i {
    font-size: 4rem;
    color: var(--green);
    margin-bottom: 1rem;
    display: block;
}

.form-success h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }

.form-success p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
    line-height: 1.7;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--green);
    color: var(--green);
    border-radius: 0.75rem;
    padding: 0.625rem 1.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}
.btn-outline:hover { background: var(--green); color: white; }

/* ── Contact ────────────────────────────────────────────────────────────── */
.contact-section h2 { margin-bottom: 0.3rem; }

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: 0.875rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
    background: #f8fafc;
}

.contact-card > i:first-child {
    font-size: 1.4rem;
    width: 28px;
    text-align: center;
    color: var(--muted);
    flex-shrink: 0;
}

.contact-card > div { flex: 1; }

.contact-card.whatsapp { border-color: #bbf7d0; background: #f0fdf4; }
.contact-card.whatsapp > i:first-child { color: #16a34a; }
.contact-card.whatsapp:hover { background: #dcfce7; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(22,163,74,0.15); }

.contact-label  { display: block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.contact-value  { display: block; font-size: 0.9rem; font-weight: 600; margin-top: 0.1rem; }
.contact-arrow  { color: var(--muted); font-size: 0.8rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    background: white;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
    .card-section   { padding: 1.5rem 1.25rem; }
    .form-grid      { grid-template-columns: 1fr; }
    .field.span-2   { grid-column: span 1; }
    .ic-search      { flex-direction: column; }
    .btn-green      { width: 100%; justify-content: center; }
}
