@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Dark Modern Gradient Background */
    background: linear-gradient(135deg, #09090b, #1e1b4b, #111827);
    background-size: 300% 300%;
    animation: gradientBG 15s ease infinite;
    padding: 20px;
    color: #f3f4f6; /* Light gray text */
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Background Light Blobs */
.bg-light-blob {
    position: fixed;
    z-index: -1;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    transition: opacity 2s ease-in-out;
}

.blob-1 {
    top: -100px;
    left: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.4) 0%, transparent 70%);
    animation: pulseLight 10s infinite alternate ease-in-out;
}

.blob-2 {
    bottom: -150px;
    right: -150px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.3) 0%, transparent 70%);
    animation: pulseLight 15s infinite alternate-reverse ease-in-out;
}

@keyframes pulseLight {
    0% { 
        opacity: 0.2; 
        transform: scale(1) translate(0, 0); 
    }
    50% { 
        opacity: 0.6; 
        transform: scale(1.1) translate(30px, 30px); 
    }
    100% { 
        opacity: 0.1; 
        transform: scale(0.9) translate(-20px, -20px); 
    }
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.8;
}

.container {
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 900px;
    /* Dark Glassmorphism */
    background: rgba(15, 23, 42, 0.4); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header img.logo {
    max-width: 100px;
    margin-bottom: 15px;
    border-radius: 12px;
}

.header h1 {
    font-weight: 600;
    color: #fff;
    font-size: 26px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}

.header p {
    color: #9ca3af;
    font-size: 14px;
}

/* Progress bar */
.progress-container {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
}

.progress-container::before {
    content: '';
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    transform: translateY(-50%);
    height: 4px;
    z-index: 1;
    border-radius: 2px;
}

.progress-bar {
    background: #6366f1; /* Indigo */
    position: absolute;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    height: 4px;
    width: 0%;
    z-index: 1;
    transition: 0.4s ease;
    border-radius: 2px;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.8);
}

.step-circle {
    background: rgba(30, 41, 59, 0.8);
    height: 35px;
    width: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #94a3b8;
    z-index: 2;
    transition: 0.4s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.step-circle.active {
    background: #1e1b4b;
    color: #a5b4fc;
    border-color: #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.step-circle.completed {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* Form Styles */
form {
    padding: 0 30px 30px;
    position: relative;
    min-height: 400px;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-title {
    font-size: 20px;
    color: #fff;
    margin-bottom: 25px;
    font-weight: 500;
    border-bottom: 1px dashed rgba(255,255,255,0.15);
    padding-bottom: 10px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

.input-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    position: relative; /* Base for lightning line */
}

/* Lightning line base */
.input-group::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #818cf8, #fff, #22d3ee, #818cf8, transparent);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0);
}

.input-group:focus-within::after {
    left: 0;
    width: 100%;
    opacity: 1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 0 5px rgba(34, 211, 238, 0.8);
    animation: lightningMove 2s linear infinite;
}

@keyframes lightningMove {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.input-group label {
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.input-group input, 
.input-group select, 
.input-group textarea {
    /* Darker input backgrounds */
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 15px;
    border-radius: 12px;
    font-size: 14px;
    color: #f8fafc;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus, 
.input-group select:focus, 
.input-group textarea:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.input-group input::placeholder, 
.input-group textarea::placeholder {
    color: #64748b;
}

.input-group select option {
    background: #1e1b4b; /* Dark dropdown items */
    color: #e2e8f0;
}

/* Date Picker Icon Visibility */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(100%) saturate(200%) hue-rotate(190deg); /* Adjust to match indigo theme */
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Radio & Checkbox styling */
.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 5px;
}
.radio-label {
    display: flex;
    align-items: center;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
}
.radio-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255,255,255,0.2);
}
.radio-label input {
    margin-right: 10px;
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Buttons */
.btn-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.1);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-2px);
}

.btn-next, .btn-submit {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
}
.btn-next:hover, .btn-submit:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

/* Suggestions Box for Autocomplete */
.suggestions {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin-top: 5px;
    display: none;
}
.suggestions.active {
    display: block;
}
.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.4;
}
.suggestion-item:last-child {
    border-bottom: none;
}
.suggestion-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
}
.relative {
    position: relative;
    width: 100%;
}

/* ============================================
   Custom Searchable School Dropdown
   ============================================ */
.school-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: rgba(10, 15, 30, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    z-index: 100;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.school-dropdown.open {
    display: flex;
}
.dropdown-search-box {
    padding: 10px 10px 5px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dropdown-search {
    width: 100%;
    background: rgba(255,255,255,0.07) !important;
    border: 1px solid rgba(99,102,241,0.3) !important;
    border-radius: 8px !important;
    padding: 9px 12px !important;
    font-size: 13px !important;
    color: #f1f5f9 !important;
}
.dropdown-search:focus {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2) !important;
}
.dropdown-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 5px 0;
}
.dropdown-list::-webkit-scrollbar { width: 5px; }
.dropdown-list::-webkit-scrollbar-track { background: transparent; }
.dropdown-list::-webkit-scrollbar-thumb { background: rgba(99,99,241,0.4); border-radius: 3px; }
.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    line-height: 1.4;
    transition: background 0.15s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item.highlighted {
    background: rgba(99, 102, 241, 0.18);
    color: #fff;
}
.dropdown-item.manual-entry {
    color: #a5b4fc;
    font-style: italic;
    background: rgba(99,102,241,0.08);
}
.dropdown-footer {
    padding: 7px 10px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #475569;
}
.dropdown-add-manual {
    background: rgba(99,102,241,0.15);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.dropdown-add-manual:hover {
    background: rgba(99,102,241,0.3);
    color: #fff;
}

/* Custom Scrollbar for suggestions */
.suggestions::-webkit-scrollbar {
    width: 6px;
}
.suggestions::-webkit-scrollbar-track {
    background: transparent;
}
.suggestions::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

/* Spinner Overlay */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    display: none;
}
.loader {
    border: 4px solid rgba(255,255,255,0.1);
    border-top: 4px solid #8b5cf6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
.loader-text {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* SweetAlert customization for Dark Mode Glassmorphism */
div:where(.swal2-container) div:where(.swal2-popup) {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #f1f5f9 !important;
}
div:where(.swal2-container) h2:where(.swal2-title) {
    color: #fff !important;
}

/* Section specific margins */
.sub-title {
    font-size: 16px;
    color: #a5b4fc;
    margin: 25px 0 15px;
    font-weight: 500;
}

/* Helper Text */
.help-text {
    font-size: 11px;
    color: #94a3b8;
    margin-top: -6px;
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Agreement Checkbox Container */
.agreement-container {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-top: 30px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.agreement-container input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #6366f1;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.agreement-container label {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
    cursor: pointer;
}

/* --- Dynamic Row Buttons --- */
.btn-add-row {
    background: rgba(99, 102, 241, 0.15);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    color: #a5b4fc;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    width: 100%;
    margin-top: 5px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-row:hover {
    background: rgba(99, 102, 241, 0.25);
    border-style: solid;
    color: #fff;
    transform: translateY(-2px);
}

.btn-remove-row {
    position: absolute;
    right: -10px;
    top: -10px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(15, 23, 42, 1);
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.btn-remove-row:hover {
    transform: scale(1.1);
    background: #dc2626;
}

.kesejahteraan-row, .prestasi-row {
    animation: slideDown 0.3s ease-out;
}

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