/* AutoSpiti Lovable Redesign */
.autospiti-sell-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #111827;
    background: #fafafa;
    padding: 40px 20px;
}

.autospiti-sell-layout {
    display: flex;
    gap: 40px;
    /* align-items: flex-start; Removed so sidebar stretches full height */
    max-width: 1100px;
    margin: 0 auto;
}

/* Left Column */
.autospiti-main-form {
    flex: 1;
    min-width: 0; 
}

.autospiti-page-header {
    margin-bottom: 32px;
}

.step-indicator {
    display: inline-block;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.autospiti-page-header h2 {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #111827;
}

.autospiti-page-header p {
    font-size: 15px;
    color: #6b7280;
    margin: 0;
}

/* Cards */
.autospiti-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.autospiti-card-header {
    margin-bottom: 24px;
}

.autospiti-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #111827;
}

.autospiti-card-header p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* Grid & Form Groups */
.autospiti-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.autospiti-form-group.full-width {
    grid-column: 1 / -1;
}

.autospiti-form-group label {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.autospiti-form-group label span.required-asterisk {
    color: #ef4444; /* Red asterisk */
    font-size: 14px;
    margin-left: 2px;
}

.autospiti-form-group input[type="text"],
.autospiti-form-group input[type="number"],
.autospiti-form-group input[type="url"],
.autospiti-form-group input[type="date"],
.autospiti-form-group textarea,
.autospiti-form-group select {
    width: 100%;
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

/* Required fields default border - removed so it's gray by default */
.autospiti-form-group input.error-border,
.autospiti-form-group select.error-border {
    border-color: #ef4444 !important;
    border-width: 2px !important;
    background-color: #fef2f2;
}

.autospiti-form-group textarea {
    height: auto;
    padding: 12px 16px;
    resize: vertical;
}

.autospiti-form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%236b7280%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 10px auto;
}

.autospiti-form-group input:focus,
.autospiti-form-group textarea:focus,
.autospiti-form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.autospiti-form-group select:disabled {
    background-color: #f9fafb;
    color: #9ca3af;
    border-color: #e5e7eb; /* Keep gray border if disabled */
    cursor: not-allowed;
}

/* Features Grid */
.autospiti-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.autospiti-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #4b5563;
}

.autospiti-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #111827;
    cursor: pointer;
}

/* File Upload */
.autospiti-file-upload {
    position: relative;
    width: 140px;
    height: 140px;
    border: 1px dashed #d1d5db; /* Default gray dashed border */
    border-radius: 12px;
    background: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}
.autospiti-file-upload.error-border {
    border-color: #ef4444 !important;
    border-width: 2px !important;
    border-style: solid;
    background-color: #fef2f2;
}

.autospiti-file-upload:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.autospiti-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-placeholder svg {
    color: #ef4444; /* Red icon to show it's required */
}

.upload-placeholder span {
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
}

.autospiti-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.preview-img-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Buttons */
.autospiti-btn {
    height: 48px;
    padding: 0 32px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 24px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.autospiti-btn-dark {
    background-color: #0f172a;
    color: #ffffff;
}

.autospiti-btn-dark:hover {
    background-color: #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.autospiti-btn-secondary {
    background-color: #f3f4f6;
    color: #4b5563;
}

.autospiti-btn-secondary:hover {
    background-color: #e5e7eb;
    color: #111827;
}

/* Right Column: Live Preview Sidebar */
.autospiti-sidebar {
    width: 320px;
    flex-shrink: 0;
    position: relative;
}

.autospiti-live-preview-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.preview-header {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.preview-image-box {
    width: 100%;
    height: 180px;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 500;
}

.preview-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-details h4 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px 0;
}

.preview-details p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.preview-price {
    font-size: 20px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 20px;
}

.preview-footer {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
}

/* Plans Wrapper */
.autospiti-plans-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.autospiti-plan-card {
    position: relative;
    cursor: pointer;
}

.autospiti-plan-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.plan-content {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    height: 100%;
    transition: all 0.3s ease;
}

.autospiti-plan-card:hover .plan-content {
    border-color: #d1d5db;
}

.autospiti-plan-card input[type="radio"]:checked + .plan-content {
    border-color: #0f172a;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.1);
    background-color: #f8fafc;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.plan-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.plan-price {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-features li {
    font-size: 14px;
    color: #4b5563;
    margin-bottom: 10px;
}

/* Loading Spinners */
#autospiti-loading {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

#autospiti-checkout-spinner {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.checkout-spinner-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: popupIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.checkout-spinner-content h3 {
    margin: 24px 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.checkout-spinner-content p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

@keyframes popupIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .autospiti-sell-layout {
        flex-direction: column;
    }
    .autospiti-sidebar {
        width: 100%;
        position: static;
        margin-top: 32px;
    }
    .autospiti-grid-2 {
        grid-template-columns: 1fr;
    }
    .autospiti-features-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================
   BEAUTIFUL DATEPICKER UI
========================================= */
.datepicker {
    padding: 16px !important;
    border-radius: 16px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
    width: 280px !important;
    background: #ffffff !important;
    z-index: 99999 !important;
}
.datepicker .datepicker-switch {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}
.datepicker table tr td span.month {
    width: 30% !important;
    height: 44px !important;
    line-height: 44px !important;
    margin: 1.5% !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #475569 !important;
    transition: all 0.2s ease !important;
}
.datepicker table tr td span.month:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}
.datepicker table tr td span.month.active,
.datepicker table tr td span.month.active:hover {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #64748b !important;
    text-shadow: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
}
.datepicker table tr td span.month.disabled,
.datepicker table tr td span.month.disabled:hover {
    color: #cbd5e1 !important;
    background: transparent !important;
    cursor: not-allowed !important;
}
.datepicker thead tr:first-child th:hover {
    background: #f8fafc !important;
    border-radius: 8px !important;
}
.datepicker .prev, .datepicker .next {
    color: #64748b !important;
    font-weight: 300 !important;
}

/* Flatpickr Custom Styles */
.flatpickr-calendar { font-family: inherit; box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important; border: none !important; }
.flatpickr-monthSelect-month.selected { background: #0534ff !important; border-color: #0534ff !important; color: #fff !important; }
.flatpickr-monthSelect-month:hover { background: #e6f0ff !important; }
