/* =============================================================================
   daftar.halopenulis.com — style.css
   Mobile-first. CSS variables per brand di-inject inline dari branding.php
   ============================================================================= */

/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Neutral palette (semua brand share) */
    --gray-900: #0f172a;
    --gray-700: #334155;
    --gray-600: #475569;
    --gray-500: #64748b;
    --gray-400: #94a3b8;
    --gray-300: #cbd5e1;
    --gray-200: #e2e8f0;
    --gray-100: #f1f5f9;
    --gray-50:  #f8fafc;
    --white:    #ffffff;
    --danger:   #dc2626;
    --danger-soft: #fef2f2;
    --success:  #059669;
    --success-soft: #ecfdf5;

    /* Brand vars diinject dari branding.php:
       --brand-primary, --brand-primary-soft, --brand-accent,
       --brand-gradient-1, --brand-gradient-2 */

    /* Spacing */
    --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
    --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;
    --radius:    10px;
    --radius-lg: 14px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(180deg, var(--brand-primary-soft) 0%, var(--white) 400px);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============ LAYOUT ============ */
.page-header {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp-8) var(--sp-5) var(--sp-6);
    text-align: center;
}

.form-container {
    max-width: 720px;
    margin: 0 auto var(--sp-10);
    padding: 0 var(--sp-5);
}

/* ============ HEADER ============ */
.brand-badge {
    display: inline-block;
    background: var(--brand-primary);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: var(--sp-4);
}
.event-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--gray-900);
    margin-bottom: var(--sp-2);
    letter-spacing: -0.5px;
}
.event-subtitle {
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 500;
}
.event-meta {
    margin-top: var(--sp-4);
    font-size: 13px;
    color: var(--gray-500);
}

/* ============ FORM ============ */
.form-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--sp-6) var(--sp-5);
    margin-bottom: var(--sp-4);
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    border: 1px solid var(--gray-200);
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--sp-2);
}
.section-hint {
    color: var(--gray-500);
    font-size: 13.5px;
    margin-bottom: var(--sp-5);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-4);
}

.field { display: flex; flex-direction: column; }
.field-full { grid-column: 1 / -1; }

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.req { color: var(--brand-primary); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14.5px;
    font-family: inherit;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%23475569' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}
input.error, select.error {
    border-color: var(--danger);
    background-color: var(--danger-soft);
}

.field-hint {
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 4px;
}
.field-error {
    color: var(--danger);
    font-size: 12.5px;
    font-weight: 500;
    margin-top: 5px;
    min-height: 0;
    display: block;
}
.field-error:empty { margin-top: 0; }

/* ============ FILE INPUT (custom) ============ */
.file-input-wrapper { position: relative; }
input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    cursor: pointer;
    z-index: 2;
}
.file-input-label {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 20px var(--sp-5);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-weight: 500;
    color: var(--gray-600);
    font-size: 14px;
}
.file-input-wrapper:hover .file-input-label {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}
.file-input-wrapper.has-file .file-input-label {
    border-color: var(--brand-primary);
    background: var(--brand-primary-soft);
    color: var(--brand-accent);
}
.file-input-icon { font-size: 20px; }
.file-input-text { flex: 1; }

/* ============ CHECKBOX ============ */
.checkbox-field {
    padding: var(--sp-4) 0;
    border-top: 1px solid var(--gray-100);
}
.checkbox-field:first-of-type { border-top: none; padding-top: 0; }
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-3);
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.55;
    font-weight: 400;
}
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--brand-primary);
    cursor: pointer;
    flex-shrink: 0;
}
.checkbox-text strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* ============ HONEYPOT (hidden from user but present in DOM) ============ */
.honeypot {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ============ SUBMIT ============ */
.submit-area {
    padding: var(--sp-2) 0 var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    align-items: stretch;
}
.btn-submit {
    background: linear-gradient(135deg, var(--brand-gradient-1), var(--brand-gradient-2));
    color: var(--white);
    border: none;
    padding: 15px var(--sp-8);
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(15,23,42,0.12);
    transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 52px;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15,23,42,0.18);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.submit-status {
    text-align: center;
    font-size: 13.5px;
    font-weight: 500;
    padding: var(--sp-2);
    min-height: 20px;
}
.submit-status.error {
    color: var(--danger);
    background: var(--danger-soft);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--radius);
    border-left: 3px solid var(--danger);
}

/* ============ SUCCESS STATE ============ */
.success-state {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--sp-10) var(--sp-6);
    text-align: center;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    border: 1px solid var(--gray-200);
}
.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-size: 40px;
    font-weight: 700;
    margin-bottom: var(--sp-5);
}
.success-state h2 {
    font-size: 24px;
    color: var(--gray-900);
    margin-bottom: var(--sp-3);
}
.success-msg {
    color: var(--gray-700);
    margin-bottom: var(--sp-4);
    font-size: 15px;
}
.success-hint {
    color: var(--gray-500);
    font-size: 13.5px;
    line-height: 1.7;
    margin-bottom: var(--sp-5);
}
.success-hint a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 600;
}
.success-hint a:hover { text-decoration: underline; }
.success-id {
    display: inline-block;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: var(--sp-2) var(--sp-4);
    border-radius: 999px;
    font-size: 12.5px;
}
.success-id code {
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--brand-accent);
    font-weight: 600;
}

/* ============ FOOTER ============ */
.page-footer {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--sp-6) var(--sp-5) var(--sp-10);
    text-align: center;
    color: var(--gray-500);
    font-size: 12.5px;
}
.footer-note { margin-top: 6px; font-size: 11.5px; color: var(--gray-400); }

/* ============ STATIC PAGES (home, form-closed, 404, error) ============ */
.static-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-8) var(--sp-5);
}
.static-content {
    max-width: 500px;
    text-align: center;
    background: var(--white);
    padding: var(--sp-10) var(--sp-6);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(15,23,42,0.08);
    border: 1px solid var(--gray-200);
}
.static-icon {
    font-size: 56px;
    margin-bottom: var(--sp-4);
    line-height: 1;
}
.static-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--sp-3);
    letter-spacing: -0.5px;
}
.static-lead {
    font-size: 16px;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: var(--sp-3);
}
.static-body {
    color: var(--gray-600);
    margin-bottom: var(--sp-5);
    line-height: 1.7;
}
.static-hint {
    color: var(--gray-500);
    font-size: 13.5px;
    margin-top: var(--sp-5);
    line-height: 1.7;
}
.static-hint a {
    color: var(--brand-primary);
    font-weight: 600;
    text-decoration: none;
}
.static-links {
    display: flex;
    gap: var(--sp-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--sp-4);
}
.btn-secondary {
    background: var(--brand-primary);
    color: var(--white);
    text-decoration: none;
    padding: 12px var(--sp-6);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    transition: background 0.15s, transform 0.1s;
}
.btn-secondary:hover {
    background: var(--brand-accent);
    transform: translateY(-1px);
}

/* ============ RESPONSIVE — TABLET+ (≥ 640px) ============ */
@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--sp-4) var(--sp-5);
    }
    .form-section {
        padding: var(--sp-8) var(--sp-6);
    }
    .event-title { font-size: 32px; }
    .page-header { padding: var(--sp-10) var(--sp-5) var(--sp-8); }
    .btn-submit { font-size: 16.5px; }
}

/* ============ RESPONSIVE — DESKTOP (≥ 900px) ============ */
@media (min-width: 900px) {
    .event-title { font-size: 36px; }
}
