/**
 * Dealer Application Widget - Clean Compact Design
 */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --fg-primary: #bb0a07;
    --fg-primary-dark: #9a0806;
    --fg-dark: #0f172a;
    --fg-gray-900: #111827;
    --fg-gray-700: #374151;
    --fg-gray-500: #6b7280;
    --fg-gray-300: #d1d5db;
    --fg-gray-100: #f3f4f6;
    --fg-gray-50: #f9fafb;
    --fg-white: #ffffff;
    --fg-success: #10b981;
}

/* Container */
.fg-dealer-widget-container {
    width: 100%;
    max-width: 480px;
    margin: 1rem auto;
    font-family: "Inter", -apple-system, sans-serif;
    color: var(--fg-gray-900);
    background: var(--fg-white);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--fg-gray-300);
    overflow: hidden;
}

/* Header */
.fg-dealer-header-modern {
    background: linear-gradient(135deg, var(--fg-dark) 0%, #1e293b 100%);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 3px solid var(--fg-primary);
}

.fg-header-content h3 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--fg-white);
}

.fg-header-content p {
    margin: 0;
    font-size: 0.7rem;
    color: #94a3b8;
}

.fg-header-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--fg-white);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fg-header-icon svg {
    width: 18px;
    height: 18px;
}

/* Inline Alert */
.fg-inline-alert {
    display: none;
    margin: 0;
    padding: 12px 14px;
    background: #fef2f2;
    border-bottom: 1px solid #fecaca;
    align-items: center;
    gap: 10px;
}

.fg-inline-alert.fg-alert-error {
    display: flex;
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.fg-inline-alert.fg-alert-success {
    display: flex;
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
}

.fg-alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fg-alert-error .fg-alert-icon {
    color: var(--fg-primary);
}

.fg-alert-success .fg-alert-icon {
    color: var(--fg-success);
}

.fg-alert-icon svg {
    width: 100%;
    height: 100%;
}

.fg-alert-message {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--fg-gray-900);
    line-height: 1.4;
}

.fg-alert-close {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--fg-gray-500);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.fg-alert-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--fg-gray-900);
}

/* Form */
.fg-dealer-form-modern {
    padding: 0;
}

.fg-form-step {
    display: none;
    padding: 0.85rem 1rem;
}

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

/* Section Header */
.fg-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed var(--fg-gray-300);
}

.fg-section-header h4 {
    margin: 0;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--fg-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.fg-section-header.mt-4 {
    margin-top: 1rem !important;
}

/* Grid */
.fg-modern-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.fg-modern-grid.three-col {
    grid-template-columns: repeat(3, 1fr);
}

.fg-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.fg-input-group.span-2 {
    grid-column: span 2;
}

.fg-input-group.full-width {
    grid-column: 1 / -1;
}

.fg-input-group label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--fg-gray-700);
}

.fg-input-group label .req {
    color: var(--fg-primary);
}

/* Inputs */
.fg-form-control {
    width: 100% !important;
    height: 34px !important;
    padding: 0 0.6rem !important;
    border: 1.5px solid var(--fg-gray-300) !important;
    border-radius: 5px !important;
    font-size: 0.8rem !important;
    color: var(--fg-gray-900) !important;
    background: var(--fg-white) !important;
    transition: border-color 0.15s !important;
    font-family: inherit !important;
    box-sizing: border-box !important;
}

.fg-form-control:hover {
    border-color: var(--fg-gray-500) !important;
}

.fg-form-control:focus {
    border-color: var(--fg-primary) !important;
    box-shadow: 0 0 0 2px rgba(187, 10, 7, 0.1) !important;
    outline: none !important;
}

.fg-form-control::placeholder {
    color: var(--fg-gray-500);
    font-size: 0.75rem;
}

.fg-form-control.error {
    border-color: var(--fg-primary) !important;
}

select.fg-form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-color: var(--fg-white) !important;
    padding-right: 24px !important;
}

textarea.fg-form-control {
    height: auto !important;
    min-height: 50px !important;
    padding: 0.4rem 0.6rem !important;
    resize: vertical;
}



/* Checkbox */
.fg-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 0.5rem;
    background: var(--fg-gray-50);
    border-radius: 5px;
    margin-top: 0.5rem;
}

.fg-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--fg-primary);
    cursor: pointer;
    margin-top: 1px;
    flex-shrink: 0;
}

.fg-checkbox-label {
    color: var(--fg-gray-700);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
}

/* Actions */
.fg-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    padding: 0.65rem 1rem;
    background: var(--fg-gray-100);
    border-top: 1px solid var(--fg-gray-300);
    margin-top: 0.75rem;
}

.fg-form-actions.two-buttons {
    justify-content: space-between;
}

/* Buttons */
.fg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 32px;
    padding: 0 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.fg-btn svg {
    width: 12px;
    height: 12px;
}

.fg-btn-next,
.fg-btn-submit {
    background: var(--fg-primary);
    color: var(--fg-white);
    box-shadow: 0 2px 4px rgba(187, 10, 7, 0.2);
}

.fg-btn-next:hover,
.fg-btn-submit:hover {
    background: var(--fg-primary-dark);
    transform: translateY(-1px);
}

.fg-btn-back {
    background: var(--fg-white);
    color: var(--fg-gray-700);
    border: 1.5px solid var(--fg-gray-300);
}

.fg-btn-back:hover {
    background: var(--fg-gray-100);
}

/* Spinner */
.fg-spinner {
    animation: spin 1s linear infinite;
    display: none;
}

.fg-btn-submit.loading .fg-spinner {
    display: block;
}

.fg-btn-submit.loading .fg-btn-text {
    display: none;
}

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

/* Response */
.fg-form-response {
    margin: 0.6rem 1rem;
    padding: 0.5rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    display: none;
}

.fg-form-response.success {
    background: #d1fae5;
    color: #065f46;
    display: block;
}

.fg-form-response.error {
    background: #fee2e2;
    color: #991b1b;
    display: block;
}

/* Mobile */
@media (max-width: 520px) {
    .fg-dealer-widget-container {
        margin: 0.5rem;
        max-width: none;
    }

    .fg-modern-grid,
    .fg-modern-grid.three-col {
        grid-template-columns: 1fr;
    }

    .fg-input-group.span-2 {
        grid-column: span 1;
    }

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

    .fg-btn {
        width: 100%;
    }
}