/**
 * Titip Jual Page Styles
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

select {
    background-image: none !important;
}

.titip-jual-page {
    background-color: #F3F1FC;
    min-height: 100vh;
    padding: 48px 0;
}

.titip-jual-form-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 96px);
}

.titip-jual-form-container {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px 40px;
    width: 100%;
    max-width: 588px;
    box-shadow: 0px 2px 4px 0px rgba(96, 97, 112, 0.16), 0px 0px 1px 0px rgba(40, 41, 61, 0.04);
}

/* ==========================================================================
   Form Header
   ========================================================================== */

.titip-jual-form-header {
    margin-bottom: 16px;
}

/* Form validation errors */
.form-validation-errors {
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.form-validation-errors ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.form-validation-errors li {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    color: #C53030;
    margin-bottom: 4px;
}

.form-validation-errors li:last-child {
    margin-bottom: 0;
}

/* Form success message */
.form-success-message {
    background: #F0FFF4;
    border: 1px solid #9AE6B4;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.form-success-message p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    color: #2F855A;
    margin: 0;
}

/* AJAX error message */
.form-ajax-error {
    background: #FFF5F5;
    border: 1px solid #FEB2B2;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.form-ajax-error p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
    color: #C53030;
    margin: 0;
}

.titip-jual-form-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.333;
    letter-spacing: 0.25px;
    color: #0D1A35;
    margin: 0 0 4px 0;
}

.titip-jual-form-subtitle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 24px;
    color: #868D9A;
    margin: 0;
}

/* ==========================================================================
   Form Sections
   ========================================================================== */

.form-section {
    margin-bottom: 24px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #0D1A35;
    margin: 0 0 16px 0;
    font-style: normal;
    line-height: 18px; /* 150% */
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* Form rows and columns removed - using single column layout */

/* ==========================================================================
   Form Fields
   ========================================================================== */

.form-field {
    margin-bottom: 16px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field-label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    color: var(--Text-Primary, #0D1A35);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: "IBM Plex Sans";
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
}

.required {
    color: #D70C24;
}

.form-field-input {
    width: 100%;
    height: 40px;
    padding: 8px 16px;
    border: 1px solid #CED3D7;
    border-radius: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.714;
    color: #0D1A35;
    background: #FFFFFF;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-field-input:focus {
    outline: none !important;
    border-color: #282161;
    box-shadow: none !important;
}

.form-field-input.error {
    border-color: #D70C24;
}

/* Error message styling */
.error-message {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    color: #D70C24;
    margin-top: 4px;
    display: none;
}

/* Error input styling - Enhanced for all field types */
input.error, 
textarea.error, 
select.error {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

/* Phone wrapper error state */
.form-field-phone-wrapper.error {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

.form-field-phone-wrapper.error .form-field-input {
    border: none !important;
    box-shadow: none !important;
}

/* Price wrapper error state */
.form-field-price-wrapper.error {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

.form-field-price-wrapper.error .form-field-input {
    border: none !important;
    box-shadow: none !important;
}

/* Radio and checkbox error states */
.form-field-radio-input.error {
    border-color: #D70C24 !important;
}

.form-field-radio-input.error + .form-field-radio-custom {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

.form-field-checkbox-input.error {
    border-color: #D70C24 !important;
}

.form-field-checkbox-input.error + .form-field-checkbox-custom {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

.form-field-input::placeholder {
    color: #B6BAC2;
}

.form-field-error {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    color: #D70C24;
    margin-top: 4px;
    clear: both;
    width: 100%;
    animation: fadeInError 0.2s ease-in-out;
}

/* Error message animation */
@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure radio/checkbox error aligns with design */
.form-field-radio-group .form-field-error,
.form-field-checkbox .form-field-error {
    margin-left: 28px;
}

/* Error state for form field containers */
.form-field.error .form-field-input,
.form-field.error .form-field-phone-wrapper,
.form-field.error .form-field-price-wrapper {
    border-color: #D70C24 !important;
    box-shadow: 0 0 0 1px #D70C24 !important;
}

/* ==========================================================================
   Phone Input
   ========================================================================== */

.form-field-phone-wrapper {
    display: flex;
    border: 1px solid #CED3D7;
    border-radius: 4px;
    background: #FFFFFF;
    overflow: hidden;
}

.form-field-phone-prefix {
    display: flex;
    align-items: center;
    padding: 8px 11px;
    background: #E7E8EB;
    border-radius: 4px 0px 0px 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.714;
    color: #0D1A35;
    white-space: nowrap;
}

.form-field-phone-wrapper .form-field-input {
    border: none;
    border-radius: 0;
    padding-left: 16px;
}

/* ==========================================================================
   Price Input
   ========================================================================== */

.form-field-price-wrapper {
    display: flex;
    border: 1px solid #CED3D7;
    border-radius: 4px;
    background: #FFFFFF;
    overflow: hidden;
}

.form-field-price-prefix {
    display: flex;
    align-items: center;
    padding: 8px 11px;
    background: #E7E8EB;
    border-radius: 4px 0px 0px 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    color: #0D1A35;
    white-space: nowrap;
}

.form-field-price-wrapper .form-field-input {
    border: none;
    border-radius: 0;
    padding-left: 16px;
}

/* ==========================================================================
   Select Dropdown
   ========================================================================== */

.form-field-select-wrapper {
    position: relative;
}

.form-field-select-wrapper .form-field-input {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

/* Placeholder color for select when no value chosen */
.form-field-select-wrapper .form-field-input.is-placeholder {
    color: #B6BAC2;
}

.form-field-select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #2951A3;
}

/* ==========================================================================
   Textarea
   ========================================================================== */

.form-field-textarea .form-field-input {
    resize: vertical;
    height: auto;
    min-height: 80px;
}

/* ==========================================================================
   Radio Buttons
   ========================================================================== */

.form-field-group {
    margin-bottom: 16px;
}

.form-field-group-label {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.714;
    color: #0D1A35;
    margin-bottom: 8px;
}

.form-field-radio-group {
    display: flex;
    gap: 24px;
}

.form-field-radio {
    margin-bottom: 0;
}

.form-field-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
    height: 32px;
}

.form-field-radio-input {
    display: none;
}

.form-field-radio-custom {
    width: 20px;
    height: 20px;
    border: 1.6px solid #989BB3;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}

.form-field-radio-input:checked + .form-field-radio-custom {
    border-color: #282161;
}

.form-field-radio-input:checked + .form-field-radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #282161;
    border-radius: 50%;
}

.form-field-radio-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.714;
    color: #0B0E21;
}

/* ==========================================================================
   Checkbox
   ========================================================================== */

.form-field-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
}

.form-field-checkbox-input {
    display: none;
}

.form-field-checkbox-custom {
    width: 16px;
    height: 16px;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 2px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    align-self: center;
    transition: all 0.2s ease;
}

.form-field-checkbox-input:checked + .form-field-checkbox-custom {
    background: #120253;
    border-color: #120253;
}

.form-field-checkbox-custom svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 9px;
    height: 7px;
    color: #FFFFFF;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-field-checkbox-input:checked + .form-field-checkbox-custom svg {
    opacity: 1;
}

.form-field-checkbox-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 2.08%;
    color: #868D9A;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

.btn-submit {
    width: 100%;
    padding: 8px 16px;
    background: #CFD0DA;
    border: none;
    border-radius: 8px;
    color: var(--Button-Label-Primary, #FFF);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: "IBM Plex Sans";
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0.08px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit:not(:disabled) {
    background: #282161;
    color: #FFFFFF;
}

.btn-submit:not(:disabled):hover {
    background: #1a1a4a;
}

.btn-submit:disabled {
    cursor: not-allowed;
}

/* ==========================================================================
   Success Popup Modal
   ========================================================================== */

.success-popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.success-popup-content {
    position: relative;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px 16px;
    width: 100%;
    max-width: 375px;
    text-align: center;
    z-index: 1;
}

.success-popup-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 600;
    font-size: 20px;
    line-height: 26px;
    color: #2951A3;
    margin: 0 0 16px 0;
}

.success-popup-icon {
    margin-bottom: 16px;
}

.success-popup-icon-circle {
    width: 64px;
    height: 64px;
    background: #120253;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.success-popup-icon svg {
    width: 41px;
    height: 33px;
}

.success-popup-message {
    margin-bottom: 16px;
}

.success-popup-message p {
    font-family: 'IBM Plex Sans', sans-serif;
    color: #525A80;
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 0.25px;
    margin: 0;
}

.success-popup-actions {
    margin-top: 16px;
}

.success-popup-close {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: 'IBM Plex Sans', sans-serif;
    color: #282161;
    cursor: pointer;
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; /* 150% */
    letter-spacing: 0.08px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.success-popup-close:hover {
    background: #F3F1FC;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .titip-jual-page {
        padding: 24px 0;
    }
    
    .titip-jual-form-container {
        padding: 24px 16px;
        margin: 0 16px;
        max-width: 343px;
    }
    
    /* Form layout is single-column by default - no mobile overrides needed */
    
    .form-field-radio-group {
        flex-direction: row;
        gap: 16px;
    }
    
    .success-popup-content {
        margin: 0 16px;
    }
}

@media (max-width: 480px) {
    .titip-jual-form-container {
        margin: 0 8px;
        padding: 16px;
    }
    
    .titip-jual-form-title {
        font-size: 16px;
    }
    
    .titip-jual-form-subtitle {
        font-size: 13px;
    }
    
    /* Mobile error message adjustments */
    .form-field-error {
        font-size: 11px;
        margin-top: 3px;
    }
    
    /* Ensure radio/checkbox error aligns properly on mobile */
    .form-field-radio-group .form-field-error,
    .form-field-checkbox .form-field-error {
        margin-left: 24px;
    }
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.modal-open {
    overflow: hidden;
}

.btn-disabled {
    background: #CFD0DA !important;
    color: #989BB3 !important;
    cursor: not-allowed !important;
}

/* ==========================================================================
   Animation
   ========================================================================== */

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

.success-popup-modal {
    animation: fadeIn 0.3s ease-out;
}

/* ==========================================================================
   Focus States
   ========================================================================== */

.form-field-input:focus,
.form-field-radio-input:focus + .form-field-radio-custom,
.form-field-checkbox-input:focus + .form-field-checkbox-custom {
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.btn-submit.loading {
    position: relative;
    color: transparent !important;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #FFFFFF;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}
