/* =========================================
   Daftar Kehadiran IPTEK - halaman publik
   Mobile first. Warna mengikuti poster: hijau natural, kuning, putih, hijau tua.
========================================= */

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

:root {
    --primary: #087443;
    --primary-dark: #065c35;
    --primary-light: #eaf7f0;

    --yellow: #f6c900;
    --orange: #f59e0b;

    --text: #172033;
    --muted: #667085;

    --border: #e4e7ec;
    --background: #f5f7f6;
    --white: #ffffff;

    --success: #16a34a;
    --danger: #dc2626;
    --danger-light: #fef2f2;
}

[hidden] {
    display: none !important;
}

html {
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--background);

    -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
dl,
dd {
    margin: 0;
}

button,
input,
select {
    font-family: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

/* =========================================
   PAGE
========================================= */

.page {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 12px 12px 35px;
}

/* =========================================
   POSTER
========================================= */

.event-poster {
    width: 100%;
    overflow: hidden;
    margin-bottom: 18px;

    border-radius: 18px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--white);
    box-shadow: 0 5px 20px rgba(16, 24, 40, 0.08);
}

.event-poster img {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================================
   HEADER
========================================= */

.header {
    margin-bottom: 14px;
    padding: 0 3px;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-bottom: 9px;
    padding: 6px 10px;

    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary);

    font-size: 12px;
    font-weight: 700;
}

.header h1 {
    margin-bottom: 6px;

    font-size: 25px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   FORM CARD
========================================= */

.form-card {
    padding: 17px;

    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.045);
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 7px;

    font-size: 14px;
    font-weight: 700;
}

.required {
    color: var(--danger);
}

/* =========================================
   INPUT (16px agar iOS tidak zoom saat fokus)
========================================= */

.input {
    width: 100%;
    height: 49px;
    padding: 0 13px;

    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    color: var(--text);

    font-size: 16px;
    outline: none;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input::placeholder {
    color: #98a2b3;
}

.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 116, 67, 0.16);
}

.input[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-error {
    margin-top: 6px;

    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================
   ATTENDANCE
========================================= */

.attendance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    margin-bottom: 9px;
}

.attendance-header .form-label {
    margin-bottom: 0;
}

.attendance-info {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.date-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.date-option {
    position: relative;
}

/* Checkbox asli disembunyikan secara visual tetapi tetap dapat difokus dengan keyboard. */
.date-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.date-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;

    width: 100%;
    min-height: 61px;
    padding: 10px 12px;

    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--white);
    cursor: pointer;

    transition: border-color 0.18s ease, background 0.18s ease, transform 0.1s ease;
}

.date-label:active {
    transform: scale(0.99);
}

.date-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.date-icon {
    flex: 0 0 39px;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 39px;
    height: 39px;

    border-radius: 10px;
    background: #f2f4f7;
    font-size: 18px;
}

.date-text {
    min-width: 0;
}

.date-text strong {
    display: block;
    margin-bottom: 2px;

    font-size: 14px;
    line-height: 1.3;
}

.date-text span {
    display: block;

    color: var(--muted);
    font-size: 12px;
    line-height: 1.3;
}

.check {
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 22px;
    height: 22px;

    border: 2px solid #d0d5dd;
    border-radius: 7px;
    color: transparent;

    font-size: 12px;
    font-weight: 800;

    transition: 0.18s ease;
}

.date-option input:checked + .date-label {
    border-color: var(--primary);
    background: #f5fbf8;
}

.date-option input:checked + .date-label .date-icon {
    background: #dff3e8;
}

.date-option input:checked + .date-label .check {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.date-option input:focus-visible + .date-label {
    outline: 3px solid rgba(8, 116, 67, 0.4);
    outline-offset: 2px;
}

/* =========================================
   HADIR SEMUA TANGGAL
========================================= */

.all-date {
    margin-top: 10px;
    padding: 2px 1px;
}

.all-date label {
    display: flex;
    align-items: center;
    gap: 9px;

    padding: 4px 0;

    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;

    cursor: pointer;
}

.all-date input {
    flex: 0 0 auto;

    width: 18px;
    height: 18px;
    margin: 0;

    accent-color: var(--primary);
    cursor: pointer;
}

.all-date input:focus-visible {
    outline: 3px solid rgba(8, 116, 67, 0.4);
    outline-offset: 2px;
}

/* =========================================
   BUTTONS
========================================= */

.submit-btn,
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 51px;
    padding: 0 16px;

    border: 0;
    border-radius: 12px;

    font-size: 15px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;

    cursor: pointer;
}

.submit-btn {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(8, 116, 67, 0.15);

    transition: background 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
}

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

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

.submit-btn:focus-visible,
.btn-secondary:focus-visible {
    outline: 3px solid rgba(8, 116, 67, 0.4);
    outline-offset: 2px;
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f9fafb;
}

/* =========================================
   MESSAGES
========================================= */

.error-message {
    margin-bottom: 12px;
    padding: 10px 12px;

    border-radius: 10px;
    background: var(--danger-light);
    color: var(--danger);

    font-size: 13px;
    line-height: 1.4;
}

.notice {
    margin-bottom: 12px;
    padding: 13px;

    border: 1px solid #fde68a;
    border-radius: 13px;
    background: #fffbeb;
}

.notice:focus {
    outline: none;
}

.notice-title {
    margin-bottom: 4px;

    font-size: 14px;
    font-weight: 700;
}

.notice-text {
    margin-bottom: 12px;

    color: #55606e;
    font-size: 13px;
    line-height: 1.5;
}

.notice-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =========================================
   FOOTER
========================================= */

.footer {
    margin-top: 13px;
    padding: 0 8px;

    text-align: center;
    color: #7a8496;
    font-size: 12px;
    line-height: 1.5;
}

/* =========================================
   SUCCESS
========================================= */

.success {
    text-align: center;
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 62px;
    height: 62px;
    margin: 2px auto 14px;

    border-radius: 50%;
    background: #dcfce7;
    color: var(--success);

    font-size: 29px;
    font-weight: 700;
}

.success h2 {
    margin-bottom: 7px;

    font-size: 21px;
    line-height: 1.25;
}

.success h2:focus {
    outline: none;
}

.success-description {
    margin-bottom: 18px;

    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.summary {
    margin-bottom: 15px;
    padding: 11px 13px;

    text-align: left;
    border: 1px solid var(--border);
    border-radius: 13px;
}

.summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;

    padding: 8px 0;

    font-size: 13px;
}

.summary-row + .summary-row {
    border-top: 1px solid #f0f1f3;
}

.summary-label {
    color: var(--muted);
}

.summary-value {
    max-width: 65%;

    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}

.error-page {
    margin-top: 24px;
}

.error-page h1 {
    margin-bottom: 8px;
    font-size: 20px;
}

.error-page p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   INSTALLER
========================================= */

.req-list {
    margin: 0 0 18px;
    padding: 0;

    list-style: none;
    font-size: 14px;
}

.req-list li {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-top: 1px solid #f0f1f3;
}

.req-list li:first-child {
    border-top: 0;
}

.req-ok {
    color: var(--success);
    font-weight: 700;
}

.req-fail {
    color: var(--danger);
    font-weight: 700;
}

.install-title {
    margin-bottom: 4px;
    font-size: 21px;
}

.install-lead {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.install-section {
    margin: 22px 0 12px;
    font-size: 15px;
}

.form-hint {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.is-visible {
    display: block;
}

/* =========================================
   DESKTOP
========================================= */

@media (min-width: 600px) {
    .page {
        padding-top: 30px;
        padding-bottom: 50px;
    }

    .header h1 {
        font-size: 28px;
    }

    .form-card {
        padding: 19px;
    }

    .notice-actions {
        flex-direction: row-reverse;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
