/* ============================================
   PPDB — form.css
   Styling khusus halaman formulir pendaftaran
   ============================================ */

/* ── Page Background ─────────────────────────── */
.form-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #eff6ff 0%, #e0f2fe 40%, #f0fdf4 100%);
    padding: 1.5rem 1rem 3rem;
}

/* ── Form Container ──────────────────────────── */
.form-container {
    max-width: 860px;
    margin: 0 auto;
}

/* ── Header Banner ───────────────────────────── */
.header-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(30,64,175,.35);
}
.header-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: .6;
}
.header-banner .banner-icon {
    width: 72px; height: 72px;
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.2rem;
    border: 2px solid rgba(255,255,255,.3);
    position: relative;
}
.header-banner .banner-icon svg { color: #fff; width: 36px; height: 36px; }
.header-banner h1 { color: #fff; font-size: clamp(1.4rem, 4vw, 2rem); position: relative; }
.header-banner p  { color: rgba(255,255,255,.85); font-size: .95rem; position: relative; margin-top: .5rem; }

/* ── Alert Info (cetak ulang) ─────────────────── */
.reprint-notice {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    text-align: center;
}
.reprint-notice p { color: #92400e; font-weight: 500; margin: 0; font-size: .9rem; }
.reprint-notice .btn { font-size: .85rem; }

/* ── Form Section ────────────────────────────── */
.form-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    animation: slideDown .35s ease;
}
.section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: .85rem;
    border-bottom: 2px solid var(--gray-100);
}
.section-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Photo Upload ────────────────────────────── */
.photo-upload-wrapper { position: relative; }
.photo-upload-area {
    border: 2.5px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--gray-50);
    position: relative;
    overflow: hidden;
}
.photo-upload-area:hover {
    border-color: var(--primary-light);
    background: #eff6ff;
    box-shadow: 0 0 0 4px var(--primary-glow);
}
.photo-upload-area.has-photo { border-style: solid; border-color: var(--primary-light); }
.photo-upload-area img#photoPreview {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}
.photo-placeholder { text-align: center; padding: 1rem; pointer-events: none; }
.photo-placeholder svg { width: 42px; height: 42px; color: var(--gray-400); margin: 0 auto .75rem; }
.photo-placeholder span { font-size: .8rem; color: var(--gray-500); display: block; }
.photo-size-info {
    font-size: .75rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: .5rem;
    line-height: 1.5;
}
.photo-size-limit {
    font-size: .75rem;
    color: var(--warning);
    font-weight: 600;
    text-align: center;
    margin-top: .25rem;
}
.photo-mobile-actions {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: 1rem;
}
.btn-action-photo {
    padding: .75rem .5rem;
    border: 1.5px solid var(--gray-100);
    border-radius: var(--radius-md);
    background: #fff;
    font-size: .85rem;
    font-weight: 700;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.btn-action-photo:active {
    transform: scale(0.96);
    background: var(--gray-50);
}
.btn-action-photo:first-child {
    border-color: #d1fae5;
    color: #059669;
}
.btn-action-photo:last-child {
    border-color: #e0f2fe;
    color: #0284c7;
}

@media (max-width: 640px) {
    .photo-mobile-actions { display: grid; }
}

/* ── Submit Button ───────────────────────────── */
.submit-section {
    text-align: center;
    padding: 2rem 0 3rem;
}
.btn-submit {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #fff;
    padding: 1.1rem 4rem;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px -5px rgba(16, 185, 129, 0.5);
}
.btn-submit:active:not(:disabled) {
    transform: translateY(-1px);
}
.btn-submit:disabled { opacity: .7; cursor: not-allowed; }
.btn-submit .loading-spinner {
    display: none;
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: .5rem;
}

/* ── Cropper Modal ───────────────────────────── */
.cropper-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.78);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    animation: slideDown .2s ease;
}
.cropper-modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    width: 100%; max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-xl);
}
.cropper-modal-header {
    padding: 1.1rem 1.5rem;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.cropper-modal-header h3 { font-size: 1rem; color: var(--primary-dark); display: flex; align-items: center; gap: .5rem; }
.cropper-modal-body {
    flex: 1; overflow: auto;
    padding: 1rem;
    background: #f8f8f8;
    min-height: 300px;
}
.cropper-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
    background: var(--white);
}
.cropper-info { font-size: .78rem; color: var(--gray-500); }
.cropper-info span { display: block; line-height: 1.6; }
.cropper-info .valid { color: var(--success); font-weight: 600; }
.cropper-info .warn  { color: var(--warning); font-weight: 600; }

.cropper-tools { display: flex; gap: .75rem; }
.btn-tool {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--primary-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-tool:hover { 
    background: var(--primary-light); 
    color: #fff;
    transform: rotate(15deg) scale(1.1);
}
.btn-tool:active { transform: scale(0.95); }

/* Modal close btn */
.btn-close-modal {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--gray-400);
    cursor: pointer;
    transition: color var(--transition);
    padding: .25rem;
}
.btn-close-modal:hover { color: var(--danger); }

/* ── Size Validation Bar ─────────────────────── */
.size-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-200);
    overflow: hidden;
    margin-top: .5rem;
}
.size-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s ease, background .3s;
    background: var(--success);
}
.size-bar-fill.near-limit { background: var(--warning); }
.size-bar-fill.over-limit  { background: var(--danger); }
.size-label { font-size: .75rem; color: var(--gray-500); margin-top: .2rem; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 640px) {
    .form-page     { padding: 1rem .75rem 2rem; }
    .header-banner { padding: 1.75rem 1.25rem; border-radius: var(--radius-lg); }
    .form-section  { padding: 1.25rem 1rem; }
    .section-title { font-size: .9rem; }
    .btn-submit    { padding: .85rem 2rem; font-size: .95rem; }
    .cropper-modal-footer { flex-direction: column-reverse; }
}
@media (max-width: 480px) {
    .header-banner h1 { font-size: 1.25rem; }
}

.cropper-container { max-height: 450px !important; }
@media (max-width: 640px) {
    .cropper-modal-box {
        max-width: 100%;
        max-height: 100%;
        height: 100vh;
        border-radius: 0;
    }
    .cropper-modal-body {
        padding: 0;
        display: flex;
        align-items: center;
        background: #000;
    }
    .cropper-container { max-height: 70vh !important; }
    .cropper-modal-footer {
        padding: 1rem;
        flex-direction: row; /* Tetap satu baris di HP agar alat terlihat */
    }
    .cropper-info { display: none; } /* Sembunyikan info teks agar lega */
}
