/* ===================================================================
   RPL Desa — Earth Tone / Organic Biophilic Theme
   Typography: Playfair Display (headings) + Inter (body)
   Colors: Sage green, gold, warm whites, earth tones
   =================================================================== */

:root {
    /* Earth tones palette */
    --sage-50: #f6f7f4;
    --sage-100: #e8ebe3;
    --sage-200: #d4dbc9;
    --sage-300: #b5c2a3;
    --sage-400: #97aa7e;
    --sage-500: #7a9262;
    --sage-600: #5f754c;
    --sage-700: #4a5d3c;
    --sage-800: #3d4c33;
    --sage-900: #2d3827;

    --gold-50: #fdfbf3;
    --gold-100: #f9f3dc;
    --gold-200: #f2e5b5;
    --gold-300: #e8d08a;
    --gold-400: #d4b45c;
    --gold-500: #c49a38;
    --gold-600: #a87e2d;
    --gold-700: #876326;

    --earth-50: #faf8f5;
    --earth-100: #f2ede6;
    --earth-200: #e6ddd0;
    --earth-300: #d4c6b0;
    --earth-400: #bfa88a;
    --earth-500: #a88e6c;
    --earth-600: #8c7354;

    --warm-white: #fdfcfa;
    --warm-cream: #f8f5f0;
    --text-primary: #2c2418;
    --text-secondary: #5a4e3e;
    --text-muted: #8a7e6e;

    --shadow-sm: 0 1px 3px rgba(44, 36, 24, 0.06);
    --shadow-md: 0 4px 12px rgba(44, 36, 24, 0.08);
    --shadow-lg: 0 8px 30px rgba(44, 36, 24, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--warm-cream) 0%, var(--sage-50) 50%, var(--gold-50) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.page-wrapper {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.site-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--sage-100);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--sage-200), var(--gold-200));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--sage-700);
    line-height: 1.2;
}

.site-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--sage-100);
    color: var(--sage-700);
}

.nav-admin {
    color: var(--gold-600);
}

/* ===== Flash Messages ===== */
.flash-container {
    max-width: 800px;
    margin: 1rem auto;
    padding: 0 1.5rem;
}

.flash {
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash-error { background: #fce4ec; color: #c62828; border: 1px solid #f8bbd0; }
.flash-warning { background: var(--gold-50); color: var(--gold-700); border: 1px solid var(--gold-200); }
.flash-info { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

/* ===== Form Page ===== */
.form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.form-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sage-800);
    margin-bottom: 0.5rem;
}

.form-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
}

.required-star { color: #c62828; font-weight: 700; }

.form-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.step {
    background: var(--sage-100);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--sage-700);
}

.step-arrow {
    color: var(--gold-400);
    font-size: 1.1rem;
    font-weight: 700;
}

/* ===== Form Sections ===== */
.form-section {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-100);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.form-section:focus-within {
    box-shadow: var(--shadow-md);
    border-color: var(--sage-300);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--sage-700);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--sage-100);
}

.section-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ===== Form Inputs ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-input {
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--earth-200);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--warm-white);
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--sage-400);
    box-shadow: 0 0 0 3px rgba(122, 146, 98, 0.12);
    background: #fff;
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%235a4e3e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--sage-500), var(--sage-600));
    color: #fff;
    box-shadow: 0 2px 8px rgba(95, 117, 76, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--sage-600), var(--sage-700));
    box-shadow: 0 4px 16px rgba(95, 117, 76, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--earth-100);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--earth-200);
}

.btn-danger {
    background: #fce4ec;
    color: #c62828;
}

.btn-danger:hover {
    background: #f8bbd0;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-full { width: 100%; justify-content: center; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--sage-100);
}

.btn-submit {
    padding: 0.8rem 2rem;
    font-size: 1rem;
}

.btn-download {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(95, 117, 76, 0.25); }
    50% { box-shadow: 0 4px 20px rgba(95, 117, 76, 0.4); }
}

/* ===== Success Page ===== */
.success-page { text-align: center; }

.success-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-100);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 650px;
    margin: 0 auto;
}

.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }

.success-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--sage-700);
    margin-bottom: 0.5rem;
}

.success-desc { color: var(--text-muted); margin-bottom: 1.5rem; }

.success-summary {
    background: var(--sage-50);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    margin: 1.5rem 0;
    text-align: left;
}

.success-summary h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--sage-700);
    margin-bottom: 0.8rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

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

.summary-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.success-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.success-note {
    background: var(--gold-50);
    border: 1px solid var(--gold-200);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1rem;
    font-size: 0.82rem;
    color: var(--gold-700);
    text-align: left;
}

/* ===== Login Page ===== */
.login-page { text-align: center; padding-top: 2rem; }

.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-100);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 400px;
    margin: 0 auto;
}

.login-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }

.login-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--sage-700);
    margin-bottom: 0.3rem;
}

.login-desc { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

.login-form { text-align: left; }

.login-form .form-group { margin-bottom: 1rem; }

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sage-100);
}

.login-footer a {
    color: var(--sage-500);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.login-footer a:hover { color: var(--sage-700); }

/* ===== Admin Page ===== */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--sage-800);
}

.admin-desc { color: var(--text-muted); font-size: 0.9rem; }

.admin-actions-top { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-100);
    box-shadow: var(--shadow-sm);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    background: var(--sage-100);
    color: var(--sage-700);
    font-weight: 600;
    text-align: left;
    padding: 0.7rem 0.8rem;
    white-space: nowrap;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table td {
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--sage-50);
    color: var(--text-primary);
}

.admin-table tbody tr:hover {
    background: var(--sage-50);
}

.actions-cell {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.inline-form { display: inline; }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--sage-200);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: 'Playfair Display', serif; color: var(--sage-700); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-verified {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.status-draft {
    background: var(--gold-50);
    color: var(--gold-700);
    border: 1px solid var(--gold-200);
}

/* ===== Verify Page ===== */
.verify-page { max-width: 750px; margin: 0 auto; }

.verify-header { text-align: center; margin-bottom: 1.5rem; }

.verify-icon { font-size: 3rem; margin-bottom: 0.8rem; }

.verify-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--sage-800);
    margin-bottom: 0.5rem;
}

.verify-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 1rem; }

.verify-warning {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: #e65100;
    display: inline-block;
}

.verify-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-100);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.verify-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.5rem;
}

.verify-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--sage-50);
}

.verify-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.verify-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.92rem;
}

.verify-empty { color: var(--text-muted); font-weight: 400; font-style: italic; }

.verify-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--sage-100);
}

.btn-verify {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    box-shadow: 0 2px 8px rgba(196, 154, 56, 0.3);
}

.btn-verify:hover {
    background: linear-gradient(135deg, var(--gold-600), var(--gold-700));
    box-shadow: 0 4px 16px rgba(196, 154, 56, 0.4);
    transform: translateY(-1px);
}

/* ===== Form Closed State ===== */
.form-closed { text-align: center; padding-top: 3rem; }

.form-closed-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--earth-300);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-sm);
    max-width: 500px;
    margin: 0 auto;
}

.closed-icon { font-size: 4rem; margin-bottom: 1rem; }

.closed-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--earth-600);
    margin-bottom: 0.8rem;
}

.closed-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.closed-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ===== Footer ===== */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--sage-100);
    margin-top: 2rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 0.5rem; }
    .section-fields { grid-template-columns: 1fr; }
    .form-title { font-size: 1.4rem; }
    .form-steps { flex-wrap: wrap; }
    .admin-header { flex-direction: column; text-align: center; }
    .admin-actions-top { justify-content: center; }
    .success-actions { flex-direction: column; align-items: center; }
    .summary-grid { grid-template-columns: 1fr; }
}
