/* Portal / Authentication Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.auth-container {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border-color);
}

.auth-container h2 { margin-bottom: 10px; font-size: 2rem; }
.auth-container p { color: var(--text-muted); margin-bottom: 30px; }

.input-group {
    margin-bottom: 20px;
    text-align: left;
}
.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--secondary-color);
}
.input-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(214,90,49,0.2);
}

.w-100 { width: 100%; }
.auth-footer { margin-top: 24px; text-align: center; font-size: 0.95rem; }
.auth-footer a { color: var(--primary-color); font-weight: 600; text-decoration: underline; }

/* Dashboard Layout */
.dashboard-page {
    min-height: 100vh;
}
.dashboard-header { margin-bottom: 40px; }
.dashboard-header h2 { font-size: 2.5rem; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.dash-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-color);
}
.dash-card.full-width { grid-column: 1 / -1; }
.dash-card h3 { margin-bottom: 24px; font-size: 1.5rem; color: var(--secondary-color); }

/* Reminders & Notifications */
.reminder-item {
    background: rgba(214,90,49,0.05); /* very light warm orange tint */
    border-left: 4px solid var(--primary-color);
    padding: 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 40px;
}
.reminder-item strong { display: block; color: var(--primary-color); font-size: 1.1rem; margin-bottom: 8px; }
.reminder-item p { margin-bottom: 16px; font-size: 0.95rem; color: var(--text-main); }

.btn-sm { padding: 8px 16px; font-size: 0.9rem; }
.btn-outline-dark { 
    background: transparent; 
    border: 2px dashed var(--border-color); 
    color: var(--text-muted); 
    padding: 14px; 
    border-radius: var(--radius-sm); 
    font-weight: 600; 
    font-size: 1rem;
    cursor: pointer; 
    transition: var(--transition); 
}
.btn-outline-dark:hover { 
    border-color: var(--primary-color); 
    color: var(--primary-color); 
    background: rgba(214,90,49,0.02);
}

/* Settings Toggles */
.settings-group {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}
.settings-group h4 { margin-bottom: 15px; font-size: 1.1rem; }
.toggle-control {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 15px;
}
.toggle-control input { display: none; }
.control {
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    position: relative;
    margin-right: 12px;
    transition: var(--transition);
}
.control::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}
.toggle-control input:checked + .control { background: var(--primary-color); }
.toggle-control input:checked + .control::after { transform: translateX(20px); }

.terms { font-size: 0.85rem; color: var(--text-muted); margin-top: 12px; line-height: 1.4; }

/* Vehicles */
.vehicle-list { display: flex; flex-direction: column; gap: 15px; }
.vehicle-item {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: var(--radius-sm);
    position: relative;
    background: var(--bg-offset);
}
.v-tag {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--white);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--primary-color);
    font-weight: 600;
}
.vehicle-item h4 { margin-bottom: 4px; font-size: 1.1rem; }
.vehicle-item p { color: var(--text-muted); font-size: 0.95rem; }

/* Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th, .history-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.history-table th { 
    font-family: var(--font-heading); 
    background: var(--bg-offset); 
    color: var(--secondary-color); 
    font-size: 0.95rem;
}
.history-table tr:hover td { background: var(--bg-offset); }

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .history-table th, .history-table td { padding: 12px 10px; font-size: 0.9rem; }
}

/* --- Authentication Tabs & Validation --- */
.auth-tabs {
    display: flex;
    background: var(--bg-offset);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tab-btn.active {
    background: var(--white);
    color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Password Requirements Checklist */
.password-checklist {
    margin-top: 8px;
    padding: 12px 14px;
    background: var(--bg-offset);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

.checklist-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--secondary-color);
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.checklist-item .check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: bold;
}

.checklist-item.valid {
    color: #16a34a;
    font-weight: 500;
}

.checklist-item.valid .check-icon::before {
    content: '✔';
}

.checklist-item.invalid .check-icon::before {
    content: '✖';
    color: #ef4444;
}

/* Modal Overlay & Dialogs */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-md);
    max-width: 520px;
    width: 100%;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--secondary-color);
}

/* Simulated Email Card */
.email-preview-card {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 16px;
    margin: 18px 0;
    text-align: left;
    font-size: 0.9rem;
}

.email-meta {
    font-size: 0.8rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.verification-code-display {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--primary-color);
    text-align: center;
    margin: 14px 0 6px 0;
    font-family: var(--font-heading);
}

.code-input-large {
    font-size: 1.8rem;
    letter-spacing: 10px;
    text-align: center;
    font-weight: 700;
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin: 12px 0;
}

.code-input-large:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(214,90,49,0.2);
}

/* Vehicle Management */
.vehicle-item {
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.vehicle-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.vehicle-item.selected {
    border-color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    background: rgba(214,90,49,0.05);
}

.vehicle-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.vehicle-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.btn-danger-sm {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.btn-danger-sm:hover {
    background: #dc2626;
    color: white;
}

/* Select Vehicle Buttons (High Contrast Dark / Black) */
.btn-dark-select {
    background: #18181b;
    color: #ffffff !important;
    border: 1.5px solid #09090b;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-dark-select:hover {
    background: #000000;
    color: #ffffff !important;
    border-color: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-dark-select.is-selected {
    background: #000000;
    color: #ffffff !important;
    border: 2px solid #000000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.btn-dark-select.is-selected .icon-check {
    color: #22c55e;
    font-size: 1rem;
    font-weight: 900;
}

/* MOT Calculator Badges & Cards */
.mot-status-container {
    margin-top: 24px;
    background: var(--bg-offset);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.badge-valid {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-warning {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fde047;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mot-dates-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}

.mot-date-box {
    background: var(--white);
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.mot-date-box label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mot-date-box .date-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--secondary-color);
}

/* Jobs Section (Upcoming vs Past) */
.jobs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.jobs-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
}

.jobs-tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    position: relative;
    transition: var(--transition);
}

.jobs-tab-btn.active {
    color: var(--primary-color);
}

.jobs-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.job-status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-upcoming {
    background: #e0f2fe;
    color: #0369a1;
}

.status-completed {
    background: #dcfce7;
    color: #15803d;
}
