/* 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;
}

.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 */
.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);
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
    flex-wrap: wrap;
    gap: 10px;
}

.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-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;
}

.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: flex-start;
        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;
    }
}