:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #10b981;
    --success-light: #d1fae5;
    --error: #ef4444;
    --error-light: #fee2e2;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f0f4f8;
    --card: #ffffff;
    --border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.mobile-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 30px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 50%, #1e3a8a 100%);
    color: #fff;
    padding: 35px 24px 50px;
    text-align: center;
    border-radius: 0 0 30px 30px;
    position: relative;
}

.header-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: inline-block;
    animation: bounce 2s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.app-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.app-header p {
    font-size: 13px;
    opacity: 0.85;
}

/* Alerts */
.alert {
    margin: -25px 16px 16px;
    padding: 14px 16px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 10;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-error {
    background: var(--error-light);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.alert-success .alert-icon {
    background: var(--success);
    color: #fff;
}

.alert-error .alert-icon {
    background: var(--error);
    color: #fff;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    margin-left: auto;
    padding: 0;
    line-height: 1;
}

/* Form Card */
.form-card {
    background: var(--card);
    margin: 0 16px;
    padding: 28px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.label-icon {
    font-size: 16px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: #f9fafb;
    color: var(--text);
    transition: all 0.25s;
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.hint {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 5px;
}

/* Select */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--text-light);
    pointer-events: none;
}

/* Radio Group */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 10px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    background: #f9fafb;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.radio-card span:first-of-type {
    font-size: 28px;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card:has(input:checked),
.radio-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: scale(1.02);
}

/* RT/RW */
.rt-rw-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.rt-rw-input {
    flex: 1;
    position: relative;
}

.rt-rw-input input {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 14px 16px 26px;
}

.rt-rw-label {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-light);
    font-weight: 500;
}

.rt-rw-separator {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-light);
    padding-bottom: 14px;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer-info {
    margin: 24px 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex: 1;
}

.stat-icon {
    font-size: 28px;
}

.stat-badge strong {
    display: block;
    font-size: 18px;
    color: var(--primary);
}

.stat-badge small {
    font-size: 11px;
    color: var(--text-light);
}

.admin-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    transition: all 0.25s;
}

.admin-link:active {
    background: var(--bg);
}

.copyright {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 24px;
    padding: 0 16px;
}
/* ==========================================
   PROMOTIONAL BANNER (FOTO CALON KADES)
   ========================================== */
.promo-banner {
    margin: 0 16px 25px; /* Setelah bar "Di data oleh", tidak perlu menumpuk header */
    padding: 6px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    position: relative;
    z-index: 10;
    transition: transform 0.3s ease;
}

.promo-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.promo-banner img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

/* Agar notifikasi alert tidak tertutup banner */
.alert {
    z-index: 20;
}
.alert-success {
    margin-top: 0;
}

/* ==========================================
   LOGIN PETUGAS (AUTENTIKASI)
   ========================================== */
.login-card-public {
    background: var(--card);
    margin: -25px 16px 20px;
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    z-index: 10;
}

.login-public-icon {
    font-size: 46px;
    margin-bottom: 10px;
}

.login-card-public h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.login-public-sub {
    font-size: 13px;
    color: var(--text-light);
    margin: 6px 0 22px;
}

.login-card-public form {
    text-align: left;
}

.login-card-public .form-group label {
    justify-content: flex-start;
}

.login-public-error {
    background: var(--error-light);
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-public-admin {
    display: inline-block;
    margin-top: 18px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.25s;
}

.login-public-admin:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* ==========================================
   SESSION USER: DI DATA OLEH
   ========================================== */
.user-session {
    margin: -25px 16px 20px;
    padding: 14px 18px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 10;
    border-left: 4px solid var(--success);
}

.user-session-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-session-icon {
    font-size: 30px;
}

.user-session-info small {
    display: block;
    font-size: 11px;
    color: var(--text-light);
}

.user-session-info strong {
    font-size: 15px;
    color: var(--text);
}

.user-session-logout {
    font-size: 12px;
    font-weight: 600;
    color: var(--error);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid #fca5a5;
    background: var(--error-light);
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.25s;
}

.user-session-logout:hover {
    background: #fecaca;
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    .mobile-container {
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }
}