/* Driver Registration Form Styles */

/* CSS Variables - Fallback if index.css doesn't load */
:root {
    --primary-color: #22c55e;
    --secondary-color: #16a34a;
    --accent-color: #15803d;
    --text-dark: #166534;
    --text-light: #6b7280;
    --bg-light: #f0fdf4;
    --bg-white: #ffffff;
    --border-color: #d1fae5;
    --success-color: #10b981;
    --hover-color: #34d399;
}

.registration-header {
    text-align: center;
    margin-bottom: 45px;
    padding: 20px 0;
}

.registration-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.registration-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Alert Messages */
.alert {
    padding: 16px 20px;
    margin-bottom: 30px;
    font-weight: 500;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.alert-error {
    background-color: #fef2f2;
    border-left-color: #dc2626;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border-left-color: #16a34a;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.alert-success a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* Registration Form */
.registration-form {
    background: var(--bg-white);
    padding: 45px 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.form-section {
    margin-bottom: 45px;
    padding-bottom: 35px;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
    scroll-margin-top: 20px;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    letter-spacing: 0.2px;
}

/* Form Grid */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

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

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

.form-group-checkbox {
    margin-bottom: 15px;
}

/* Form Labels */
.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.1px;
}

.form-label .form-label-optional {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.88em;
}

.required {
    color: #e74c3c;
}

/* Form Inputs */
.form-input {
    padding: 13px 16px;
    border: 1.5px solid #dee2e6;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fafbfc;
    color: var(--text-dark);
    width: 100%;
    box-sizing: border-box;
}

.form-input:hover {
    border-color: #adb5bd;
    background-color: var(--bg-white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}

.form-input.error,
.form-select.error,
input[type="file"].error {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
}

.form-input.error:focus,
.form-select.error:focus,
input[type="file"].error:focus {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
}

/* Error message for fields */
.form-group.has-error .form-label::after {
    content: ' - Please fill this field';
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 500;
}

.form-input::placeholder {
    color: #bbb;
}

/* Select Dropdown */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

.form-select:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a2332' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.form-select option {
    padding: 10px;
}

/* Date Input Wrapper */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input {
    flex: 1;
    padding-right: 45px;
}

.date-icon {
    position: absolute;
    right: 15px;
    pointer-events: none;
    font-size: 1.2rem;
    opacity: 0.6;
}

.date-input:focus + .date-icon {
    opacity: 1;
}

/* Improve date input appearance */
.date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0;
    position: absolute;
    right: 0;
    width: 100%;
    height: 100%;
}

.date-input::-webkit-datetime-edit {
    padding: 0;
}

.date-input::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}

.date-input::-webkit-datetime-edit-text {
    color: var(--text-light);
    padding: 0 4px;
}

.date-input::-webkit-datetime-edit-month-field,
.date-input::-webkit-datetime-edit-day-field,
.date-input::-webkit-datetime-edit-year-field {
    color: var(--text-dark);
    padding: 0 2px;
}

.date-input::-webkit-datetime-edit-month-field:focus,
.date-input::-webkit-datetime-edit-day-field:focus,
.date-input::-webkit-datetime-edit-year-field:focus {
    background-color: rgba(26, 35, 50, 0.1);
    color: var(--primary-color);
}

.file-input {
    padding: 8px;
    cursor: pointer;
}

.file-input::-webkit-file-upload-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    margin-right: 10px;
    font-weight: 500;
}

.file-input::-webkit-file-upload-button:hover {
    background-color: var(--secondary-color);
}

.hidden-file-input {
    display: none;
}

/* Camera Capture Container */
.camera-capture-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 10px;
}

.capture-preview {
    width: 100%;
    min-height: 250px;
    max-height: 500px;
    border: 2px dashed var(--border-color);
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}

.capture-preview img {
    width: 100%;
    height: auto;
    max-height: 400px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.preview-image {
    display: none;
}

.preview-image.preview-visible {
    display: block;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.preview-placeholder.preview-hidden {
    display: none;
}

.preview-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.preview-text {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
}

.capture-buttons {
    display: flex;
    justify-content: center;
}

.btn-capture {
    width: 100%;
    max-width: 300px;
    padding: 12px 20px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-capture:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.2);
}

.btn-capture:active {
    transform: translateY(0);
}

.btn-capture-secondary {
    background-color: #ffffff;
    color: #1a2332;
    border: 2px solid #1a2332;
    margin-top: 10px;
}

.btn-capture-secondary:hover {
    background-color: #1a2332;
    color: #ffffff;
    border-color: #1a2332;
}

/* Camera Modal */
.camera-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: auto;
}

.camera-modal-content {
    background-color: var(--bg-white);
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.camera-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.camera-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.camera-modal-close {
    background: none;
    border: none;
    color: var(--bg-white);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.camera-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.camera-container {
    position: relative;
    width: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    max-height: 70vh;
    overflow: hidden;
}

#cameraVideo {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
}

#cameraCanvas {
    display: none;
}

.camera-controls {
    padding: 20px 25px;
    display: flex;
    gap: 15px;
    justify-content: center;
    background-color: var(--bg-light);
}

.btn-capture-photo,
.btn-switch-camera {
    padding: 14px 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-capture-photo {
    background-color: var(--primary-color);
    color: var(--bg-white);
    flex: 1;
    max-width: 200px;
    justify-content: center;
}

.btn-capture-photo:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.2);
}

.btn-switch-camera {
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-switch-camera:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* Form Hints */
/* ID camera capture (passenger registration step 4) — responsive, card layout */
.id-capture-block {
    position: relative;
    margin-bottom: 1.25rem;
}
/* Passenger registration: show ID back capture only after front photo is set */
.id-capture-block--after-front:not(.id-capture-block--visible) {
    display: none;
}
.id-capture-ui {
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: clamp(0.875rem, 3vw, 1.25rem);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 20px rgba(34, 197, 94, 0.06);
}
.id-capture-viewport {
    position: relative;
    width: 100%;
    max-width: 36rem;
    margin: 0 auto;
    aspect-ratio: 4 / 3;
    max-height: min(52vh, 22rem);
    border-radius: 0;
    overflow: hidden;
    background: linear-gradient(155deg, #1f2937 0%, #0f1419 45%, #111827 100%);
    border: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.18);
}
.id-capture-viewport--has-media {
    border-color: rgba(34, 197, 94, 0.35);
}
@media (min-width: 480px) {
    .id-capture-viewport {
        aspect-ratio: 3 / 2;
        max-height: min(48vh, 24rem);
    }
}
@media (min-width: 768px) {
    .id-capture-viewport {
        max-height: min(44vh, 26rem);
    }
}
.id-capture-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(1rem, 4vw, 1.75rem);
    color: #9ca3af;
    z-index: 1;
    pointer-events: none;
}
.id-capture-placeholder__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(3rem, 10vw, 3.75rem);
    height: clamp(3rem, 10vw, 3.75rem);
    margin-bottom: 0.75rem;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.06);
    color: #6ee7b7;
    font-size: clamp(1.25rem, 4vw, 1.6rem);
}
.id-capture-placeholder__title {
    display: block;
    font-size: clamp(0.95rem, 2.8vw, 1.05rem);
    font-weight: 600;
    color: #e5e7eb;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}
.id-capture-placeholder__text {
    display: block;
    font-size: clamp(0.8rem, 2.4vw, 0.875rem);
    line-height: 1.45;
    max-width: 18rem;
    color: #9ca3af;
}
.id-capture-video,
.id-capture-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-position: center;
}
.id-capture-video {
    object-fit: cover;
    z-index: 2;
}
.id-capture-preview {
    object-fit: contain;
    background: #0a0c0f;
    z-index: 2;
}
.id-capture-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
    margin-top: clamp(1rem, 3vw, 1.25rem);
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 380px) {
    .id-capture-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 640px) {
    .id-capture-toolbar {
        grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
        gap: 0.75rem;
    }
}
.id-capture-toolbar .id-capture-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding-left: 0.9rem;
    padding-right: 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    width: 100%;
    box-sizing: border-box;
}
.id-capture-toolbar .id-capture-btn i {
    font-size: 1rem;
    opacity: 0.95;
}
.id-capture-toolbar .id-capture-btn[hidden] {
    display: none !important;
}
.id-capture-hint {
    margin: 0.875rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #6b7280;
    text-align: center;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}
.id-capture-file-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Address search suggestions (passenger registration, Philippines) */
.address-search-wrap {
    position: relative;
}
.address-suggestions {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    max-height: 240px;
    overflow-y: auto;
    background-color: var(--bg-white, #fff);
    border: 1px solid #dee2e6;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 60;
}
.address-suggestions li {
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.35;
    border-bottom: 1px solid #f3f4f6;
}
.address-suggestions li:last-child {
    border-bottom: none;
}
.address-suggestions li:hover,
.address-suggestions li[aria-selected="true"] {
    background-color: #f3f4f6;
}
.address-suggestions .address-suggestions__meta {
    display: block;
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

/* Philippines phone: fixed +63 prefix (passenger registration) */
.phone-ph-field {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0;
    background-color: var(--bg-white);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.phone-ph-field:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
}
.phone-ph-prefix {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    background-color: #f3f4f6;
    border-right: 1px solid #dee2e6;
    user-select: none;
}
.phone-ph-field .phone-ph-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.phone-ph-field .phone-ph-input:focus {
    box-shadow: none !important;
}
.phone-ph-field .form-input.error {
    border: none !important;
}
.phone-ph-field:has(.phone-ph-input.error) {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1) !important;
}

/* Live email availability (registration) */
.email-availability-msg {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}
.email-availability-msg[hidden] {
    display: none !important;
}
.email-availability-msg--error {
    color: #e74c3c;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-dark);
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label .link {
    color: var(--primary-color);
    text-decoration: underline;
}

.checkbox-label .link:hover {
    color: var(--hover-color);
}

/* Legal document modal (Terms / Privacy on registration) */
.legal-modal {
    position: fixed;
    z-index: 10001;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.legal-modal[hidden] {
    display: none !important;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.legal-modal-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 720px;
    max-height: min(90vh, 900px);
    background: var(--bg-white);
    border-radius: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.legal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--primary-color);
    color: var(--bg-white);
    flex-shrink: 0;
}

.legal-modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.legal-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.75rem;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.legal-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.legal-modal-body {
    flex: 1;
    min-height: 0;
    background: var(--bg-white);
}

.legal-modal-frame {
    display: block;
    width: 100%;
    height: min(75vh, 720px);
    border: 0;
    background: var(--bg-white);
}

.legal-modal-trigger {
    display: inline;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    vertical-align: baseline;
}

.legal-modal-trigger:hover {
    color: var(--hover-color);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Registration (auth): keep steps centered on narrow viewports */
body.auth-app .step-indicator {
    justify-content: center;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 0 0 auto;
}

.step-number {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background-color: var(--bg-white);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

.step-item.completed .step-number {
    background-color: var(--success-color);
    color: var(--bg-white);
    border-color: var(--success-color);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    text-align: center;
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step-item.step-item--navigable {
    cursor: pointer;
}

.step-item.step-item--navigable:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
    border-radius: 0;
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: var(--border-color);
    min-width: 30px;
    max-width: 80px;
    transition: background-color 0.3s ease;
}

.step-item.completed ~ .step-line {
    background-color: var(--success-color);
}

.step-item.active ~ .step-line {
    background-color: var(--primary-color);
}

/* Step Content */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeInStep 0.4s ease-in;
}

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

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 35px;
    border-top: 2px solid #e9ecef;
}

.step-navigation {
    justify-content: space-between;
}

.btn-prev,
.btn-next {
    min-width: 120px;
}

/* Registration wizard: no hover “lift” / ripple — feedback via .is-reg-loading */
@keyframes reg-btn-spin {
    to {
        transform: rotate(360deg);
    }
}

.registration-form .step-navigation .btn {
    transition: opacity 0.2s ease;
}

/* Hide ripple only when not loading (spinner also uses ::before on .btn-primary) */
.registration-form .step-navigation .btn-primary:not(.is-reg-loading)::before {
    display: none;
}

.registration-form .step-navigation .btn-primary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
    transform: none;
    box-shadow: 0 2px 8px rgba(26, 35, 50, 0.2);
}

.registration-form .step-navigation .btn-primary:active {
    transform: none;
    box-shadow: 0 2px 8px rgba(26, 35, 50, 0.28);
}

.registration-form .step-navigation .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    white-space: nowrap;
}

.registration-form .step-navigation .btn-submit:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.15);
}

.registration-form .step-navigation .btn-submit:active {
    transform: none;
}

.registration-form .step-navigation .btn-secondary:hover,
.registration-form .step-navigation a.btn.btn-secondary.btn-cancel:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: none;
}

.registration-form .step-navigation .btn.is-reg-loading {
    position: relative;
    pointer-events: none;
    cursor: progress;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 44px;
}

/* Spinner on ::after so label reads first; kill ::before (ripple + old spinner) */
.registration-form .step-navigation .btn.is-reg-loading::before {
    display: none !important;
    content: none !important;
}

.registration-form .step-navigation .btn.is-reg-loading::after {
    content: '';
    display: block;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-top-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    animation: reg-btn-spin 0.75s cubic-bezier(0.55, 0.1, 0.3, 0.9) infinite;
}

.registration-form .step-navigation .btn-secondary.is-reg-loading::after {
    border-color: rgba(22, 163, 74, 0.22);
    border-top-color: var(--primary-color);
}

/* Submit: calmer full-width loading bar on mobile + no harsh contrast */
.registration-form .step-navigation .btn-submit.is-reg-loading {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 1;
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 10px rgba(22, 101, 52, 0.22);
}

.registration-form .step-navigation .btn-submit.is-reg-loading::after {
    width: 1.2rem;
    height: 1.2rem;
    border-width: 2px;
    border-color: rgba(255, 255, 255, 0.18);
    border-top-color: #fff;
}

.btn-cancel {
    margin-left: auto;
}

.btn-submit {
    min-width: 220px;
    padding: 15px 35px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 12px rgba(26, 35, 50, 0.15);
}

.btn-submit:hover {
    box-shadow: 0 6px 16px rgba(26, 35, 50, 0.2);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    min-width: 120px;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

/* Responsive Design */
@media (max-width: 768px) {
    .registration-header {
        margin-bottom: 30px;
        padding: 15px 0;
    }

    .registration-form {
        padding: 30px 25px;
        margin: 0 15px;
    }

    .registration-title {
        font-size: 1.9rem;
        margin-bottom: 10px;
    }

    .registration-subtitle {
        font-size: 0.95rem;
        padding: 0 10px;
    }

    .form-section {
        margin-bottom: 35px;
        padding-bottom: 25px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

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

    .form-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .form-input {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.35rem;
        margin-bottom: 22px;
        padding-bottom: 10px;
    }

    .step-indicator {
        margin-bottom: 30px;
        padding: 15px 10px;
        gap: 6px;
    }

    .step-item {
        flex-shrink: 0;
    }

    .step-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.75rem;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .step-line {
        min-width: 15px;
        max-width: 35px;
    }

    .form-actions {
        flex-direction: column;
        margin-top: 35px;
        padding-top: 30px;
        gap: 12px;
    }

    .step-navigation {
        flex-direction: column;
    }

    .btn-prev,
    .btn-next,
    .btn-submit,
    .btn-secondary {
        width: 100%;
        min-width: unset;
    }

    .btn-cancel {
        margin-left: 0;
        order: 4;
    }

    .btn-submit {
        padding: 14px 30px;
    }
}

@media (max-width: 480px) {
    .registration-header {
        margin-bottom: 25px;
        padding: 12px 0;
    }

    .registration-form {
        padding: 22px 18px;
        margin: 0 10px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .registration-title {
        font-size: 1.65rem;
        margin-bottom: 8px;
    }

    .registration-subtitle {
        font-size: 0.9rem;
        padding: 0 5px;
    }

    .form-section {
        margin-bottom: 28px;
        padding-bottom: 22px;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 18px;
        padding-bottom: 8px;
    }

    .form-grid {
        gap: 16px;
    }

    .form-label {
        font-size: 0.85rem;
        margin-bottom: 7px;
    }

    .form-input {
        padding: 11px 14px;
        font-size: 0.9rem;
        border-width: 1px;
    }

    .form-hint {
        font-size: 0.8rem;
        margin-top: 4px;
    }

    .step-indicator {
        margin-bottom: 25px;
        padding: 10px 5px;
        gap: 3px;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: center;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .step-indicator::-webkit-scrollbar {
        height: 4px;
    }

    .step-indicator::-webkit-scrollbar-track {
        background: var(--bg-light);
    }

    .step-indicator::-webkit-scrollbar-thumb {
        background: var(--primary-color);
    }

    .step-item {
        flex-shrink: 0;
        min-width: 50px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        border-width: 2px;
    }

    .step-label {
        font-size: 0.65rem;
        white-space: nowrap;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .step-line {
        min-width: 10px;
        max-width: 20px;
        flex-shrink: 0;
    }

    .form-actions {
        margin-top: 30px;
        padding-top: 25px;
        gap: 10px;
    }

    .btn-submit {
        padding: 13px 25px;
        font-size: 1rem;
    }

    .checkbox-label {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }

    .btn-capture {
        width: 100%;
        max-width: none;
    }

    .camera-modal-content {
        width: 100%;
        margin: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .camera-container {
        flex: 1;
        min-height: auto;
    }

    #cameraVideo {
        max-height: 100%;
    }

    .camera-controls {
        flex-direction: column;
        padding: 15px;
    }

    .btn-capture-photo,
    .btn-switch-camera {
        width: 100%;
        max-width: none;
    }
}

/* Extra Small Devices - 360px and below */
@media (max-width: 360px) {
    .registration-form {
        padding: 30px 20px;
    }

    .registration-title {
        font-size: 1.75rem;
    }

    .registration-subtitle {
        font-size: 0.95rem;
    }

    .step-indicator {
        margin-bottom: 20px;
        padding: 8px 5px;
        gap: 2px;
    }

    .step-item {
        min-width: 45px;
    }

    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
        border-width: 1.5px;
    }

    .step-label {
        font-size: 0.6rem;
        max-width: 50px;
    }

    .step-line {
        min-width: 8px;
        max-width: 15px;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }

    .form-group label {
        font-size: 0.85rem;
    }

    .form-input,
    .form-select {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .btn {
        padding: 11px 20px;
        font-size: 0.85rem;
    }
}

/* ── Driver wallet (preview / design) ── */
.driver-wallet-page {
    padding-bottom: 24px;
}

.driver-wallet-header-icon {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.driver-wallet-preview-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 0.88rem;
    line-height: 1.45;
}

.driver-wallet-preview-banner i {
    margin-top: 2px;
    flex-shrink: 0;
}

.driver-wallet-balance-card {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    border-radius: 14px;
    padding: 20px 18px;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.28);
}

.driver-wallet-balance-card__eyebrow {
    margin: 0 0 6px;
    font-size: 0.82rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.driver-wallet-balance-card__amount {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.driver-wallet-balance-card__hint {
    margin: 10px 0 0;
    font-size: 0.85rem;
    opacity: 0.88;
}

.driver-wallet-rank-hero {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.driver-wallet-rank-hero__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.driver-wallet-rank-hero__title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.driver-wallet-rank-hero__week {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

.driver-wallet-rank-hero__pill {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 8px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.driver-wallet-rank-hero__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.driver-wallet-rank-stat {
    text-align: center;
    padding: 14px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.driver-wallet-rank-stat--primary {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-color: #bbf7d0;
}

.driver-wallet-rank-stat__value {
    display: block;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}

.driver-wallet-rank-stat--primary .driver-wallet-rank-stat__value {
    color: #15803d;
}

.driver-wallet-rank-stat__label {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--text-light);
}

.driver-wallet-podium {
    margin-bottom: 18px;
}

.driver-wallet-podium__stage {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    padding: 8px 4px 0;
}

.driver-wallet-podium-place {
    flex: 1;
    max-width: 108px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 6px 12px;
    border-radius: 12px 12px 0 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    min-height: 88px;
}

.driver-wallet-podium-place--gold {
    min-height: 118px;
    background: linear-gradient(180deg, #fef9c3 0%, #fef08a 100%);
    border-color: #fde047;
    order: 2;
}

.driver-wallet-podium-place--silver {
    min-height: 100px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    order: 1;
}

.driver-wallet-podium-place--bronze {
    min-height: 92px;
    background: linear-gradient(180deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fdba74;
    order: 3;
}

.driver-wallet-podium-place--you {
    box-shadow: 0 0 0 2px #22c55e;
}

.driver-wallet-podium-place__medal {
    font-size: 1.1rem;
    line-height: 1;
    margin-bottom: 6px;
}

.driver-wallet-podium-place__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.driver-wallet-podium-place--gold .driver-wallet-podium-place__avatar {
    width: 46px;
    height: 46px;
    font-size: 0.95rem;
}

.driver-wallet-podium-place__name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.25;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.driver-wallet-podium-place__prize {
    font-size: 0.8rem;
    font-weight: 800;
    color: #15803d;
    margin-bottom: 2px;
}

.driver-wallet-podium-place--gold .driver-wallet-podium-place__prize {
    font-size: 0.88rem;
    color: #a16207;
}

.driver-wallet-podium-place__trips {
    font-size: 0.68rem;
    color: var(--text-light);
    font-weight: 600;
}

.driver-wallet-leaderboard {
    margin-bottom: 16px;
}

.driver-wallet-leaderboard__title {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.driver-wallet-leaderboard__title i {
    color: #16a34a;
}

.driver-wallet-leaderboard__sub {
    margin: 0 0 12px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.driver-wallet-leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.driver-wallet-leaderboard-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
}

.driver-wallet-leaderboard-row--you {
    background: #ecfdf5;
    border-color: #86efac;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.12);
}

.driver-wallet-leaderboard-row__rank {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
}

.driver-wallet-leaderboard-row__trophy {
    font-size: 1.1rem;
}

.driver-wallet-leaderboard-row__trophy--1 {
    color: #ca8a04;
}

.driver-wallet-leaderboard-row__trophy--2 {
    color: #64748b;
}

.driver-wallet-leaderboard-row__trophy--3 {
    color: #c2410c;
}

.driver-wallet-leaderboard-row__name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-dark);
    min-width: 0;
}

.driver-wallet-leaderboard-row__you {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 999px;
    background: #16a34a;
    color: #fff;
    vertical-align: middle;
}

.driver-wallet-leaderboard-row__meta {
    text-align: right;
    white-space: nowrap;
}

.driver-wallet-leaderboard-row__prize {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    color: #15803d;
    line-height: 1.2;
}

.driver-wallet-leaderboard-row__trips {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
}

.driver-wallet-leaderboard-row__trips small {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-light);
}

.driver-wallet-rank-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 0.85rem;
    line-height: 1.45;
}

.driver-wallet-rank-note i {
    margin-top: 2px;
    flex-shrink: 0;
}

.driver-wallet-rank-note p {
    margin: 0;
}