/* ==========================================================================
   DEW MOTORS - Auth & Buyer Dashboard Stylesheet
   ========================================================================== */

/* Glassmorphism Auth Card */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    animation: authFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Floating Input Group */
.form-group-floating {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input-floating {
    width: 100%;
    padding: 16px 14px 6px 14px;
    background: #f8fafc;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: var(--radius);
    outline: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-input-floating:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-label-floating {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.2s ease;
}

/* Float label when focused or not empty */
.form-input-floating:focus ~ .form-label-floating,
.form-input-floating:not(:placeholder-shown) ~ .form-label-floating {
    top: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-toggle-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-toggle-link span {
    color: var(--accent);
    font-weight: 600;
}

.auth-toggle-link span:hover {
    text-decoration: underline;
}

/* Buyer Dashboard Layout */
.dashboard-container {
    max-width: 1300px;
    margin: 2rem auto 6rem auto;
    padding: 0 4%;
}

.dashboard-header-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.dashboard-header-title h2 {
    font-size: 2.2rem;
    font-weight: 800;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Sidebar */
.dashboard-sidebar {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.sidebar-profile {
    text-align: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), #3b82f6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 auto 1rem auto;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.25);
}

.profile-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.profile-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-menu-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent);
}

.sidebar-menu-btn.active {
    background: rgba(29, 78, 216, 0.08);
    color: var(--accent);
}

/* Dashboard Panels */
.dashboard-panel {
    display: none;
    animation: panelFade 0.4s ease;
}

.dashboard-panel.active {
    display: block;
}

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

.panel-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

/* Saved Cars list */
.saved-cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.saved-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.saved-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.saved-card-img {
    height: 170px;
    object-fit: cover;
    width: 100%;
}

.saved-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.saved-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.saved-card-price {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.saved-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* Inquiries Table / Cards */
.inquiry-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.inquiry-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    transition: var(--transition);
}

.inquiry-card:hover {
    box-shadow: var(--shadow);
    border-color: rgba(29, 78, 216, 0.15);
}

.inquiry-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.inquiry-type-badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
    color: #475569;
}

.inquiry-type-badge.financing { background: #eff6ff; color: #1d4ed8; }
.inquiry-type-badge.tradein { background: #faf5ff; color: #7e22ce; }
.inquiry-type-badge.reserve { background: #ecfdf5; color: #047857; }

.inquiry-car-title {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.inquiry-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Status Badges */
.status-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-pill::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.status-pill.pending { background: #fef3c7; color: #b45309; }
.status-pill.pending::before { background: #d97706; }

.status-pill.contacted { background: #e0f2fe; color: #0369a1; }
.status-pill.contacted::before { background: #0284c7; }

.status-pill.reserved { background: #d1fae5; color: #047857; }
.status-pill.reserved::before { background: #059669; }

.status-pill.completed { background: #d1fae5; color: #047857; }
.status-pill.completed::before { background: #059669; }

.status-pill.cancelled { background: #fee2e2; color: #b91c1c; }
.status-pill.cancelled::before { background: #dc2626; }

/* Documents Hub Mockup */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.doc-item-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

.doc-item-card:hover {
    background: #ffffff;
    border-color: rgba(29, 78, 216, 0.15);
    box-shadow: var(--shadow-sm);
}

.doc-icon {
    font-size: 1.8rem;
}

.doc-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.doc-status-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Spinner Loader */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: var(--accent);
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

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

/* Button Loading State */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-header-auth {
    background: rgba(29, 78, 216, 0.08);
    color: var(--accent);
    border: 1px solid rgba(29, 78, 216, 0.2);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition);
}

.btn-header-auth:hover {
    background: var(--accent);
    color: white;
}

/* Header Auth Container & Dropdown */
#auth-header-container {
    position: relative;
    z-index: 10005;
}

.auth-header-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 42px;
    height: 42px;
}

.auth-header-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.auth-header-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10010;
    overflow: hidden;
}

.auth-header-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* User Menu Dropdown Variant (Logged In) */
.user-dropdown-content {
    padding: 24px;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.user-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #1e4ed8 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.user-dropdown-info {
    display: flex;
    flex-direction: column;
}

.user-dropdown-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
}

.user-dropdown-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-body);
}

.user-dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.user-dropdown-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--accent);
}

.user-dropdown-item.logout {
    color: #ef4444;
}

.user-dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

@media (max-width: 600px) {
    .auth-header-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        border-bottom: none;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
        background: white;
    }
    
    .auth-header-dropdown.show {
        transform: translateY(0);
    }
}

/* Auth Modal Overlay & Card */
.auth-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(13, 17, 23, 0.4);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

.auth-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal-card {
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
    padding: 40px;
    position: relative;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-overlay.show .auth-modal-card {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: rotate(90deg);
}

@media (max-width: 600px) {
    .auth-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .auth-modal-card {
        padding: 30px 20px 40px 20px;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%) scale(1);
        border-bottom: none;
        border-left: none;
        border-right: none;
    }
    .auth-modal-overlay.show .auth-modal-card {
        transform: translateY(0) scale(1);
    }
}
