/* ============================================
   PSB FORM - CUSTOM CSS
   Mobile First
   Color Palette: WITAMA (Teal + Cream + Yellow)
   ============================================ */

:root {
    /* Primary / Brand Colors */
    --teal: #20A7B2;
    --teal-2: #40A3A8;
    --teal-light: #95D4D9;
    --teal-light-2: #B5E3E5;
    
    /* Backgrounds */
    --teal-bg: #DBF2F0;
    --teal-bg-light: #EDFCFA;
    --cream: #FBF5E1;
    --cream-2: #F6F0DC;
    
    /* Yellow / Beige */
    --yellow: #F8DC9B;
    --yellow-dark: #ECB63A;
    --beige: #E8E2C4;
    
    /* Text */
    --text: #515C54;
    --text-light: #768179;
    --black: #201F17;
    --text-placeholder: #A7B0A4;
    
    /* Border */
    --border: #CFEAE8;
    --border-strong: #95D4D9;
}

body.psb-form-page {
    background: #f5f8f7;
    padding-bottom: 32px;
}

/* ============================================
   HEADER
   ============================================ */
.psb-form-header {
    background: linear-gradient(135deg, #20A7B2 0%, #40A3A8 100%);
    color: white;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(32, 167, 178, 0.2);
}

.psb-form-header .container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.psb-back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
    font-size: 16px;
    transition: background 0.2s;
    border: none;
}

.psb-back-btn:hover,
.psb-back-btn:active {
    background: rgba(255,255,255,0.3);
    color: white;
}

.psb-form-header-text {
    flex: 1;
    min-width: 0;
}

.psb-form-header-text h1 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: white;
}

.psb-form-header-text p {
    font-size: 12px;
    margin: 2px 0 0;
    opacity: 0.9;
    color: white;
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.psb-progress-wrapper {
    background: white;
    padding: 12px 0;
    box-shadow: 0 2px 4px rgba(32, 167, 178, 0.08);
    position: sticky;
    top: 72px;
    z-index: 99;
}

.psb-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.psb-progress-label {
    font-size: 12px;
    color: #768179;
    font-weight: 600;
}

.psb-progress-value {
    font-size: 13px;
    font-weight: 700;
    color: #20A7B2;
}

.psb-progress-track {
    height: 6px;
    background: #CFEAE8;
    border-radius: 3px;
    overflow: hidden;
}

.psb-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #20A7B2, #40A3A8);
    border-radius: 3px;
    width: 0;
    transition: width 0.3s ease;
}

.psb-progress-bar.complete {
    background: linear-gradient(90deg, #10b981, #059669);
}

/* ============================================
   MAIN FORM
   ============================================ */
.psb-form-main {
    padding-top: 16px;
}

.psb-alert {
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.psb-alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.psb-alert i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.psb-error-list {
    padding-left: 18px;
    margin: 0;
}

/* ============================================
   SECTION
   ============================================ */
.psb-form-section {
    background: white;
    border-radius: 16px;
    padding: 20px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(32, 167, 178, 0.08);
    border: 1px solid #CFEAE8;
}

.psb-form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #CFEAE8;
}

.psb-form-section-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.psb-form-section-num {
    font-size: 10px;
    color: #A7B0A4;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.psb-form-section-title {
    font-size: 16px;
    font-weight: 700;
    color: #20A7B2;
    margin: 0;
}

/* ============================================
   FORM GROUP
   ============================================ */
.psb-form-group {
    margin-bottom: 18px;
}

.psb-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #201F17;
    margin-bottom: 8px;
    line-height: 1.4;
}

.psb-required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 2px;
}

/* ============================================
   INPUT FIELD - PASTI KELIHATAN
   ============================================ */
.psb-input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #CFEAE8;
    border-radius: 10px;
    font-size: 15px;
    color: #515C54;
    background: #EDFCFA;
    transition: all 0.2s ease;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none;
    outline: none;
    min-height: 50px;
    line-height: 1.4;
}

.psb-input:focus {
    border-color: #20A7B2;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(32, 167, 178, 0.15);
    outline: none;
}

.psb-input::placeholder {
    color: #A7B0A4;
    font-size: 14px;
    opacity: 1;
}

.psb-textarea {
    resize: vertical;
    min-height: 90px;
    padding: 14px 16px;
}

/* Input Date khusus - biar lebih jelas */
input[type="date"].psb-input {
    -webkit-appearance: none;
    appearance: none;
    padding: 13px 16px;
}

input[type="date"].psb-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
}

/* Input Number */
input[type="number"].psb-input {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type="number"].psb-input::-webkit-outer-spin-button,
input[type="number"].psb-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.psb-hint {
    display: block;
    font-size: 12px;
    color: #768179;
    margin-top: 6px;
    line-height: 1.4;
}

/* ============================================
   RADIO GROUP
   ============================================ */
.psb-radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.psb-radio {
    position: relative;
    cursor: pointer;
    display: block;
    margin: 0;
}

.psb-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.psb-radio-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 12px;
    border: 2px solid #CFEAE8;
    border-radius: 10px;
    background: #EDFCFA;
    font-size: 14px;
    font-weight: 600;
    color: #768179;
    text-align: center;
    transition: all 0.2s;
    min-height: 52px;
    cursor: pointer;
}

.psb-radio input:checked + .psb-radio-label {
    border-color: #20A7B2;
    background: #DBF2F0;
    color: #20A7B2;
    box-shadow: 0 0 0 3px rgba(32, 167, 178, 0.1);
}

.psb-radio input:focus + .psb-radio-label {
    box-shadow: 0 0 0 4px rgba(32, 167, 178, 0.15);
}

/* ============================================
   UPLOAD BOX
   ============================================ */
.psb-upload-info {
    background: #DBF2F0;
    border: 1px solid #B5E3E5;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 12px;
    color: #40A3A8;
    margin-bottom: 16px;
    line-height: 1.5;
}

.psb-upload-info i {
    font-size: 16px;
    margin-top: 1px;
    flex-shrink: 0;
}

.psb-upload-box {
    position: relative;
    border: 2px dashed #95D4D9;
    border-radius: 12px;
    background: #EDFCFA;
    transition: all 0.2s;
    overflow: hidden;
}

.psb-upload-box:hover {
    border-color: #20A7B2;
    background: #DBF2F0;
}

.psb-upload-box.has-file {
    border-style: solid;
    border-color: #10b981;
    background: #ecfdf5;
}

.psb-upload-box.has-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.psb-file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.psb-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    cursor: pointer;
    text-align: center;
    margin: 0;
}

.psb-upload-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #20A7B2, #40A3A8);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
}

.psb-upload-title {
    font-size: 14px;
    font-weight: 700;
    color: #20A7B2;
    margin-bottom: 2px;
}

.psb-upload-sub {
    font-size: 11px;
    color: #768179;
}

.psb-file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: white;
    border-top: 1px solid #d1fae5;
}

.psb-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.psb-file-info i {
    color: #10b981;
    font-size: 18px;
    flex-shrink: 0;
}

.psb-file-name {
    font-size: 12px;
    color: #515C54;
    word-break: break-all;
    line-height: 1.3;
    font-weight: 600;
}

.psb-file-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.psb-file-remove:hover {
    background: #fecaca;
}

/* ============================================
   PERNYATAAN (CHECKBOX)
   ============================================ */
.psb-statement {
    background: #FBF5E1;
    border: 1px solid #E8E2C4;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.psb-checkbox {
    display: flex;
    gap: 10px;
    cursor: pointer;
    align-items: flex-start;
    margin: 0;
}

.psb-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.psb-checkbox-mark {
    width: 22px;
    height: 22px;
    border: 2px solid #ECB63A;
    border-radius: 6px;
    flex-shrink: 0;
    background: white;
    position: relative;
    transition: all 0.2s;
    margin-top: 1px;
}

.psb-checkbox-mark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

.psb-checkbox input:checked + .psb-checkbox-mark {
    background: #ECB63A;
    border-color: #ECB63A;
}

.psb-checkbox input:checked + .psb-checkbox-mark::after {
    opacity: 1;
}

.psb-checkbox-text {
    font-size: 13px;
    color: #201F17;
    line-height: 1.6;
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.psb-btn-submit {
    display: block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #20A7B2 0%, #40A3A8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(32, 167, 178, 0.3);
    margin-bottom: 12px;
    text-decoration: none;
}

.psb-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(32, 167, 178, 0.4);
    color: white;
}

.psb-btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.psb-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.psb-btn-submit i {
    margin-right: 6px;
}

.psb-form-note {
    text-align: center;
    font-size: 12px;
    color: #768179;
    padding: 8px 0;
}

.psb-form-note i {
    color: #10b981;
    margin-right: 4px;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.psb-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(32, 31, 23, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.psb-loading-content {
    background: white;
    border-radius: 16px;
    padding: 32px 40px;
    text-align: center;
    max-width: 280px;
}

.psb-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #DBF2F0;
    border-top-color: #20A7B2;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: psb-spin 0.8s linear infinite;
}

@keyframes psb-spin {
    to { transform: rotate(360deg); }
}

.psb-loading-content p {
    font-size: 14px;
    font-weight: 600;
    color: #20A7B2;
    margin: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.psb-form-page .psb-footer {
    background: transparent;
    color: #768179;
    padding: 16px;
}

.psb-form-page .psb-footer strong {
    color: #20A7B2;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 576px) {
    .psb-form-header {
        padding: 20px 0;
    }
    
    .psb-form-header-text h1 {
        font-size: 20px;
    }
    
    .psb-form-header-text p {
        font-size: 13px;
    }
    
    .psb-progress-wrapper {
        top: 88px;
    }
    
    .psb-form-section {
        padding: 24px 20px;
    }
    
    .psb-form-section-icon {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    
    .psb-form-section-title {
        font-size: 17px;
    }
    
    .psb-radio-label {
        font-size: 15px;
        min-height: 56px;
    }
    
    .psb-input {
        font-size: 15px;
        padding: 15px 18px;
    }
    
    .psb-btn-submit {
        font-size: 17px;
        padding: 18px;
    }
}

@media (min-width: 768px) {
    .psb-form-main {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
}