/* =========================================================
   AB Auto Loans — Standalone Stylesheet
   ========================================================= */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

/* Prevent iOS auto-zoom on input focus */
@media (max-width: 640px) {
    .field-input { font-size: 16px !important; }
    .otp-input   { font-size: 16px !important; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f7fa;
    color: #1a202c;
    min-height: 100vh;
}

/* Layout */
#app { display: flex; flex-direction: column; min-height: 100vh; }

main {
    flex-grow: 1;
    padding: 1rem;
    margin-bottom: 2rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    main { padding: 1.25rem 1rem; margin-bottom: 4rem; margin-top: 1.25rem; }
}

/* Container */
.form-container {
    max-width: 640px;
    margin: 0 auto;
}

/* Progress Bar */
.progress-wrap {
    max-width: 640px;
    margin: 0 auto 2rem;
}

.progress-track {
    position: relative;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

#progress-bar-fill {
    position: absolute;
    left: 0; top: 0;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #2563eb);
    border-radius: 3px;
    transition: width 0.35s ease;
}

.progress-label {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.4rem;
}

/* Step containers */
.step-container { animation: fadeSlideIn 0.22s ease; }
.step-container.hidden { display: none !important; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Typography */
h1 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.75rem;
    text-align: center;
    margin-top: 1.25rem;
}

h2 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
    text-align: center;
    margin-top: 2.5rem;
}

/* Vehicle Grid */
.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.625rem;
    width: 100%;
    max-width: 600px;
    margin: 2rem auto 0;
}

@media (min-width: 480px) {
    .vehicle-grid { gap: 1rem; }
}

.vehicle-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid #e2e8f0;
    padding: 0.625rem 0.5rem 0.875rem;
    cursor: pointer;
    background: #fff;
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

@media (min-width: 480px) {
    .vehicle-item { padding: 1rem 1rem 1.25rem; }
}

.vehicle-item:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.15);
}

.vehicle-item.selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.vehicle-item label { cursor: pointer; width: 100%; display: flex; flex-direction: column; align-items: center; }
.vehicle-item input[type="radio"] { display: none; }

.vehicle-item img {
    width: 100%;
    max-width: 160px;
    min-height: 80px;
    pointer-events: none;
    object-fit: contain;
    margin-top: 0.5rem;
}

@media (min-width: 480px) {
    .vehicle-item img { max-width: 220px; min-height: 120px; }
}

.vehicle-item span {
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.75rem;
    line-height: 1.4;
    pointer-events: none;
}

/* Radio Rows */
.radio-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.radio-row {
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    padding: 0.5rem 0.625rem;
    background: #fff;
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.radio-row:hover { border-color: #3b82f6; background: #eff6ff; }
.radio-row.selected { border-color: #3b82f6; background: #eff6ff; }
.radio-row input[type="radio"] { display: none; }

.radio-icon { margin-right: 0.625rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; }

.radio-icon svg { width: 1.25rem; height: 1.25rem; }

.radio-icon .icon-empty { fill: #94a3b8; display: block; }
.radio-icon .icon-filled { fill: #3b82f6; display: none; }

.radio-row.selected .radio-icon .icon-empty { display: none; }
.radio-row.selected .radio-icon .icon-filled { display: block; }

.radio-label { flex-grow: 1; text-align: center; font-size: 1rem; line-height: 1.75rem; }

/* Input Fields */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.25rem 0.875rem;
    transition: border-color 0.15s;
}

.input-group:focus-within { border-color: #3b82f6; }
.input-group:focus-within .floating-label { color: #3b82f6; }

.input-inner { flex-grow: 1; position: relative; }

.floating-label {
    position: relative;
    display: flex;
    height: 1.25rem;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
    pointer-events: none;
    transition: all 0.15s;
    transform: translateY(0.75rem);
}

.floating-label.active,
.floating-label.shrunk {
    font-size: 0.7rem;
    transform: translateY(0);
}

.field-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: #1a202c;
    padding: 0;
    line-height: 1.5;
}

/* Flag divider */
.flag-divider {
    position: absolute;
    left: 2.75rem;
    top: 0;
    height: 100%;
    border-right: 1px solid #e2e8f0;
}

.field-stack { display: flex; flex-direction: column; gap: 1.25rem; }

.mt-hint {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
}

/* AddressVerify / Congratulations panel */
.verify-panel {
    max-width: 28rem;
    margin: 1.25rem auto 0;
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

.verify-panel h2 { font-weight: 700; font-size: 1.125rem; margin-top: 1rem; }

.verify-city-box {
    margin: 0.625rem auto 0;
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 6px;
    min-height: 2.5rem;
}

.verify-terms {
    margin-top: 0.625rem;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.5;
}

/* OTP */
.otp-grid {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
    margin-top: 2rem;
}

.otp-cell {
    width: clamp(2.75rem, 18vw, 3.5rem);
}

.otp-box {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 0.875rem;
    transition: border-color 0.15s;
}

.otp-box:focus-within { border-color: #3b82f6; }

.otp-input {
    text-align: center;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
}

/* Buttons */
#btn-container {
    display: flex;
    gap: 1.25rem;
    margin-top: 2rem;
}

#btn-back {
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #374151;
    border-radius: 8px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

#btn-back:hover { background: #e2e8f0; border-color: #cbd5e1; }
#btn-back.hidden { display: none !important; }

#btn-continue,
#btn-submit {
    flex-grow: 1;
    max-width: 24rem;
    margin: 0 auto;
    display: block;
    border: none;
    border-radius: 8px;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    background: linear-gradient(to bottom, #3b82f6, #2563eb);
    color: #fff;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

#btn-continue:hover,
#btn-submit:hover {
    background: linear-gradient(to bottom, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37,99,235,0.35);
}

#btn-continue:active,
#btn-submit:active { transform: translateY(0); }

#btn-continue.hidden,
#btn-submit.hidden { display: none !important; }

/* Loading */
.loading-text {
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #3b82f6;
    padding: 1rem 0;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* DOB & Name steps */
.step-inputs { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1.25rem; }

/* Congrats check icon */
.check-icon { margin: 0 auto; display: block; }

/* Utility */
.text-hint { margin-top: 1.25rem; text-align: center; font-size: 0.75rem; color: #64748b; }
