/* ============================================================
   SPMB SMK YPP Purworejo - Main Stylesheet
   ============================================================ */

:root {
    --primary: #1a3c6e;
    --primary-light: #2563eb;
    --primary-dark: #0f2447;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gradient-main: linear-gradient(135deg, #0f2447 0%, #1a3c6e 50%, #2563eb 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b, #fbbf24);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 30px rgba(37, 99, 235, 0.3);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--gray-900);
    color: var(--gray-800);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ============================================================
   BACKGROUND PARTICLES
   ============================================================ */
.particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background: var(--gradient-main);
    overflow: hidden;
}

.particles::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    top: -100px; right: -100px;
    border-radius: 50%;
    animation: float1 8s ease-in-out infinite;
}

.particles::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
    bottom: -100px; left: -100px;
    border-radius: 50%;
    animation: float2 10s ease-in-out infinite;
}

.particle-dot {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: drift linear infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-30px, 30px) scale(1.1); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(0.9); }
}

@keyframes drift {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    position: relative;
    z-index: 10;
    padding: 20px 0;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-circle {
    width: 56px; height: 56px;
    background: var(--gradient-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 13px;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
    text-align: center;
    line-height: 1;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.header-title p {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.header-badge {
    background: var(--gradient-accent);
    padding: 8px 18px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.badge-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 13px;
    color: var(--white);
    white-space: nowrap;
}

/* ============================================================
   PROGRESS STEPS
   ============================================================ */
.progress-container {
    position: relative;
    z-index: 10;
    padding: 24px 24px 0;
    max-width: 900px;
    margin: 0 auto;
}

.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: default;
    transition: var(--transition);
}

.step-circle {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: rgba(255,255,255,0.4);
    transition: var(--transition);
}

.step span {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
    font-weight: 500;
    transition: var(--transition);
}

.step.active .step-circle {
    background: var(--gradient-accent);
    border-color: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.step.active span {
    color: var(--accent-light);
    font-weight: 700;
}

.step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: var(--white);
}

.step.completed .step-circle::after {
    content: '✓';
}

.step.completed span {
    color: var(--success);
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.1);
    margin: 0 12px;
    margin-bottom: 28px;
    transition: var(--transition);
    min-width: 40px;
}

.step-line.completed {
    background: var(--success);
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.main-container {
    position: relative;
    z-index: 10;
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 60px;
}

/* ============================================================
   FORM CARD
   ============================================================ */
.form-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

/* ============================================================
   FORM STEPS
   ============================================================ */
.form-step {
    display: none;
    padding: 36px;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   STEP HEADER
   ============================================================ */
.step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--gray-100);
}

.step-icon {
    font-size: 36px;
    width: 60px; height: 60px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-header h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.step-header p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================================
   SECTION LABELS
   ============================================================ */
.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(26, 60, 110, 0.05), rgba(37, 99, 235, 0.08));
    border-left: 4px solid var(--primary-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.section-label-icon {
    font-size: 20px;
}

.section-label h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

/* ============================================================
   FORM GRID
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    letter-spacing: 0.01em;
}

.required {
    color: var(--danger);
    margin-left: 2px;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

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

input:focus, select:focus, textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--gray-300);
}

input.error, select.error, textarea.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.02);
}

.error-msg {
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
    display: none;
    animation: shake 0.3s ease;
}

.error-msg.visible {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ============================================================
   PHOTO UPLOAD
   ============================================================ */
.photo-upload-area {
    width: 100%;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
}

.photo-upload-area:hover {
    border-color: var(--primary-light);
    background: rgba(37, 99, 235, 0.03);
}

.photo-placeholder {
    text-align: center;
    padding: 40px 24px;
    color: var(--gray-400);
}

.photo-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.photo-placeholder p {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.photo-placeholder small {
    font-size: 12px;
    color: var(--gray-400);
}

.photo-preview img {
    max-width: 150px;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    margin: 20px auto;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   STEP NAVIGATION
   ============================================================ */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 2px solid var(--gray-100);
}

.btn-next, .btn-prev, .btn-submit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-next {
    background: var(--gradient-main);
    color: var(--white);
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(26, 60, 110, 0.3);
}

.btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 60, 110, 0.4);
}

.btn-prev {
    background: var(--gray-100);
    color: var(--gray-600);
    box-shadow: none;
}

.btn-prev:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-submit {
    background: linear-gradient(135deg, #059669, #10b981);
    color: var(--white);
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    font-size: 16px;
    padding: 16px 32px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-icon {
    font-size: 18px;
}

/* ============================================================
   CONFIRMATION
   ============================================================ */
.confirmation-grid {
    display: grid;
    gap: 20px;
}

.confirm-section {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.confirm-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
}

.confirm-table {
    width: 100%;
    border-collapse: collapse;
}

.confirm-table tr:nth-child(even) {
    background: rgba(0,0,0,0.02);
}

.confirm-table td {
    padding: 10px 18px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}

.confirm-table td:first-child {
    color: var(--gray-500);
    width: 45%;
    font-weight: 500;
}

.confirm-table td:last-child {
    color: var(--gray-800);
    font-weight: 600;
}

/* ============================================================
   TERMS BOX
   ============================================================ */
.terms-box {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-width: 20px;
    cursor: pointer;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    accent-color: var(--success);
    margin-top: 2px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 24px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.visible {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: bounceIn 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.modal-card h2 {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.modal-card p {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 20px;
}

.nomor-pendaftaran-box {
    background: var(--gray-50);
    border: 2px dashed var(--primary-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 20px 0;
}

.nomor-pendaftaran-box small {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.nomor-pendaftaran-box strong {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.modal-note {
    font-size: 12px !important;
    color: var(--gray-400) !important;
    margin-bottom: 28px !important;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-download-pdf {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-download-pdf:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

.btn-new-form {
    width: 100%;
    padding: 14px;
    background: var(--gray-100);
    color: var(--gray-600);
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-new-form:hover {
    background: var(--gray-200);
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    text-align: center;
    color: var(--white);
}

.spinner {
    width: 64px; height: 64px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    font-size: 16px;
    font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .header-title h1 {
        font-size: 16px;
    }

    .form-step {
        padding: 24px 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .step span {
        display: none;
    }

    .progress-steps {
        padding: 12px;
        gap: 0;
    }

    .step-line {
        min-width: 20px;
    }

    .step-navigation {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn-next, .btn-prev, .btn-submit {
        width: 100%;
        justify-content: center;
    }

    .modal-card {
        padding: 32px 24px;
    }
}
