/* Global Reset & Base Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #ffffff;
    min-height: 100vh;
    color: #1f2937;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 40px 20px;
}

/* Page Wrapper Container */
.page-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Form Container Card */
.bajet-form-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 0;
    width: 100%;
    transition: all 0.3s ease;
}

/* Form Header Section */
.form-header {
    text-align: center;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid #f3f4f6;
}

.badge-title {
    display: inline-block;
    padding: 6px 16px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 100px;
    margin-bottom: 12px;
    border: 1px solid #bfdbfe;
}

.form-header h2 {
    color: #0f172a;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 8px;
}

.form-header .subtitle {
    color: #64748b;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 24px;
}

/* Progress Section */
.progress-section {
    max-width: 1100px;
    margin: 0 auto;
}

/* Stepper Nodes Visual Indicator */
.stepper-nodes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
    padding: 0 10px;
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.node-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2.5px solid #cbd5e1;
    color: #64748b;
    font-weight: 800;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-label {
    font-size: 0.825rem;
    font-weight: 600;
    color: #64748b;
    transition: color 0.3s ease;
}

.step-node.active .node-num {
    border-color: #2563eb;
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
    transform: scale(1.1);
}

.step-node.active .node-label {
    color: #1d4ed8;
    font-weight: 700;
}

.step-node.completed .node-num {
    border-color: #16a34a;
    background-color: #16a34a;
    color: #ffffff;
}

.step-node.completed .node-label {
    color: #15803d;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #f1f5f9;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e2e8f0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 100px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: #64748b;
}

.step-indicator strong {
    color: #1e293b;
    font-weight: 700;
}

/* Form Steps */
.form-step {
    display: none;
}

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

/* Section Header Box */
.section-header {
    margin-bottom: 32px;
    background: #edf5ff;
    padding: 20px 24px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.section-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 800;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.section-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.35rem;
    color: #0f172a;
    font-weight: 700;
}

.section-desc {
    margin: 0;
    font-size: 0.95rem;
    color: #64748b;
}

/* Form Grid & Input Fields */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

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

.form-group.full-width {
    margin-top: 8px;
    margin-bottom: 28px;
}

.form-group label {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 8px;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group label .required {
    color: #ef4444;
}

.form-group label .optional {
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: none;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background-color: #f4f6f8;
    transition: all 0.2s ease;
}

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

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "▾";
    font-size: 1.1rem;
    color: #64748b;
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    cursor: pointer;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="email"]::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

/* Error Validation State */
.form-group.has-error input:not([type="radio"]):not([type="checkbox"]),
.form-group.has-error select,
.form-group.has-error textarea,
.form-group.has-error .radio-card,
.focus-grid.has-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-group.has-error .radio-card:has(input[type="radio"]:checked) {
    background-color: #eff6ff;
    border-color: #2563eb;
}

.error-message {
    display: none;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
}

.form-group.has-error .error-message,
#fokusError.show {
    display: block;
}

/* Radio Grid Step 1 */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 8px;
}

.radio-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    user-select: none;
}

.radio-card:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.radio-card input[type="radio"] {
    margin-right: 10px;
    accent-color: #2563eb;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-card .radio-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

.radio-card:has(input[type="radio"]:checked) {
    background-color: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.radio-card input[type="radio"]:checked + .radio-label {
    color: #1d4ed8;
    font-weight: 700;
}

/* STEP 2: Focus Cards Grid (10 Items) */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.focus-card {
    display: flex;
    align-items: flex-start;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.focus-card:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.focus-card input[type="checkbox"] {
    display: none;
}

.focus-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.focus-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e2e8f0;
    color: #475569;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.focus-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
}

.focus-card:has(input[type="checkbox"]:checked) {
    background-color: #eff6ff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.focus-card input[type="checkbox"]:checked ~ .focus-content .focus-num {
    background-color: #2563eb;
    color: #ffffff;
}

.focus-card input[type="checkbox"]:checked ~ .focus-content .focus-title {
    color: #1d4ed8;
    font-weight: 700;
}

/* STEP 3: Image 1 Design Matching for Structured Questions */
.teras-section-block,
.tunggak-section-block {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e2e8f0;
}

.teras-section-block:last-child,
.tunggak-section-block:last-child {
    border-bottom: none;
}

.teras-main-title,
.tunggak-main-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 24px;
}

.q-block {
    margin-bottom: 28px;
}

.q-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    line-height: 1.5;
}

.q-radio-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.q-radio-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.q-radio-card:hover {
    background-color: #f8fafc;
}

.q-radio-card input[type="radio"] {
    display: none;
}

.q-circle-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.q-radio-card input[type="radio"]:checked + .q-circle-dot {
    background-color: #3b82f6;
    box-shadow: inset 0 0 0 5px #ffffff;
}

.q-option-text {
    font-size: 0.975rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

.q-radio-card input[type="radio"]:checked ~ .q-option-text {
    color: #0f172a;
    font-weight: 600;
}

.q-checkbox-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.q-checkbox-card:hover {
    background-color: #f8fafc;
}

.q-checkbox-card.disabled-option {
    opacity: 0.5;
    cursor: not-allowed;
}

.q-checkbox-card input[type="checkbox"] {
    display: none;
}

.q-check-box {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background-color: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
    border: 2px solid #cbd5e1;
}

.q-checkbox-card input[type="checkbox"]:checked + .q-check-box {
    background-color: #2563eb;
    border-color: #2563eb;
}

.q-checkbox-card input[type="checkbox"]:checked + .q-check-box::after {
    content: '';
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.q-checkbox-card input[type="checkbox"]:checked ~ .q-option-text {
    color: #0f172a;
    font-weight: 600;
}

.free-text-label {
    display: block;
    font-size: 0.925rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.free-textarea {
    width: 100%;
    padding: 14px 18px;
    background-color: #f4f6f8;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1f2937;
    transition: all 0.2s ease;
    resize: vertical;
    min-height: 110px;
}

.free-textarea:focus {
    outline: none;
    background-color: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.char-count-line {
    display: flex;
    justify-content: flex-end;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 6px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.char-count-line.warning {
    color: #d97706;
    font-weight: 600;
}

.char-count-line.danger {
    color: #dc2626;
    font-weight: 700;
}

.additional-cadangan-box {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
}

.file-upload-box {
    background-color: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    margin-top: 32px;
}

.file-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-name-text {
    display: block;
    font-size: 0.925rem;
    color: #1e293b;
    word-break: break-all;
}

.file-size-text {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
}

.btn-remove-file {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.file-hint {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 8px;
}

/* Checkbox Confirmation (Step 4) */
.checkbox-group {
    margin-top: 10px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: #2563eb;
    cursor: pointer;
}

.checkbox-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.5;
}

/* Summary Card (Step 4) */
.summary-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 28px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #cbd5e1;
    font-size: 0.95rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    font-weight: 600;
    color: #64748b;
}

.summary-val {
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

/* STEP 5: Success Screen */
.success-screen {
    text-align: center;
    padding: 40px 20px;
}

.success-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: #f0fdf4;
    border: 2px solid #bbf7d0;
    margin-bottom: 24px;
}

.success-screen h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 12px;
}

.success-msg {
    font-size: 1.1rem;
    color: #475569;
    margin-bottom: 28px;
}

.ref-box {
    display: inline-block;
    background-color: #f1f5f9;
    padding: 16px 32px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    margin-bottom: 36px;
}

.ref-box span {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}

.ref-box strong {
    font-size: 1.5rem;
    color: #2563eb;
    letter-spacing: 1px;
}

/* Spinner Loader */
.spinner-loader {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* Buttons & Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.form-actions.align-right {
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 36px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #3b82f6;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-success {
    background-color: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn:active {
    transform: translateY(0);
}

/* Responsive Breakdown */
@media (max-width: 900px) {
    .focus-grid {
        grid-template-columns: 1fr;
    }

    .radio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px 10px;
    }

    .form-header h2 {
        font-size: 1.75rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }

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

    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn {
        width: 100%;
    }
}
