/* Buyback Form - Bootstrap 5 + custom overrides */

body {
    background-color: #fff;
    font-family: "Nanum Gothic", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: #0f0f0f;
    font-size: 14px;
}

.form-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px 24px 64px;
}

.logo {
    margin-bottom: 10px;
    width: 80px;
    height: 80px;
}

.form-header h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.form-header p {
    font-size: 16px;
}

.form-field {
    padding: 16px 0;
    border-top: 1px solid #f3f4f6;
}

.form-field:first-child {
    border-top: none;
}

.form-field label {
    font-weight: 700;
}

label.required::after {
    content: " *";
    color: #fb2c36;
    font-weight: 900;
    font-size: 16px;
}

.hint {
    font-size: 13px;
    color: #737373;
    margin-bottom: 6px;
}

.notice {
    font-size: 13px;
    font-weight: 500;
    color: #d44c47;
    text-decoration: underline;
    margin-top: 6px;
}

.notice p {
    margin: 0;
}

.error-message {
    font-size: 12px;
    color: #fb2c36;
    margin-top: 4px;
}

/* --- Bootstrap form overrides --- */
.form-control:focus,
.form-select:focus {
    border-color: #518b32;
    border-width: 2px;
    box-shadow: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-width: 2px;
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: none;
}

/* --- TomSelect Overrides --- */
.ts-dropdown .ts-dropdown-content .option {
    padding: 6px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.ts-dropdown .ts-dropdown-content .option:last-child {
    border-bottom: none;
}

/* --- File upload --- */
.file-area {
    position: relative;
    border: 1px dashed #d4d4d4;
    border-radius: 4px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}

.file-area:hover,
.file-area.is-dragover {
    border-color: #518b32;
    background: #f9fcf8;
}

.file-area.is-invalid {
    border-color: #fb2c36;
    border-width: 2px;
}

.file-area input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-area svg {
    display: block;
    margin: 0 auto 6px;
    width: 28px;
    height: 28px;
    color: #a3a3a3;
}

.file-area .file-text {
    font-size: 13px;
    color: #737373;
}

.file-area .file-limit {
    font-size: 12px;
    color: #a3a3a3;
    margin-top: 4px;
}

/* --- File preview --- */
.file-list {
    margin-top: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 4px;
    margin-bottom: 4px;
}

.file-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.file-item .file-info {
    flex: 1;
    min-width: 0;
}

.file-item .file-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item .file-size {
    font-size: 12px;
    color: #a3a3a3;
}

.file-item .file-remove {
    background: none;
    border: none;
    color: #a3a3a3;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    flex-shrink: 0;
}

.file-item .file-remove:hover {
    color: #fb2c36;
}

/* --- Privacy --- */
.privacy-box {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 16px;
    color: #525252;
    background: #f9f9f9;
    margin-bottom: 12px;
}

.privacy-box p {
    margin: 0 0 8px;
}

.privacy-box p:last-child {
    margin-bottom: 0;
}

.privacy-box strong {
    color: #0f0f0f;
}

/* --- Submit --- */
.btn-submit {
    width: 100%;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #518b32;
    border: none;
    border-radius: 4px;
}

.btn-submit:hover {
    opacity: 0.85;
}

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

/* --- Complete page --- */
.complete {
    text-align: center;
    padding: 24px 0;
}

.complete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f0f8ec;
    margin-bottom: 20px;
}

.complete-icon svg {
    width: 28px;
    height: 28px;
    color: #518b32;
}

.complete h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.complete-message {
    font-size: 14px;
    color: #525252;
    margin-bottom: 24px;
    line-height: 1.8;
}

.lot-box {
    display: inline-block;
    background: #f9fcf8;
    border: 1px solid #cbe7bc;
    border-radius: 4px;
    padding: 12px 28px;
    margin-bottom: 24px;
}

.lot-label {
    font-size: 12px;
    color: #737373;
    margin-bottom: 2px;
}

.lot-value {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.complete-note {
    font-size: 13px;
    color: #737373;
    margin-bottom: 24px;
    line-height: 1.7;
}

.btn-return {
    display: inline-block;
    text-decoration: none;
    width: auto;
}

/* --- Loading overlay --- */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.is-active {
    display: flex;
}

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

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #518b32;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-text {
    margin-top: 12px;
    font-size: 14px;
    color: #525252;
}
