/* ═══════════════════════════════════════════════════
   Bạn Say Tôi Lái — Global Styles
   Mirrors the Flutter app's blue/white/grey design
   ═══════════════════════════════════════════════════ */

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
}

body {
    background: #F5F5F5;
    color: #212121;
}

/* ── App wrapper ──────────────────────────────── */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Splash / Loading screen ──────────────────── */
.loading-screen {
    min-height: 100vh;
    background: #1565C0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── Auth container (Register + OTP) ─────────── */
.auth-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header row ───────────────────────────────── */
.auth-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.app-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.app-title    { font-size: 20px; font-weight: 700; color: #212121; }
.app-subtitle { font-size: 13px; color: #9E9E9E; }

/* ── Typography ───────────────────────────────── */
.form-heading {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #212121;
}

.form-sub {
    font-size: 14px;
    color: #757575;
    line-height: 1.5;
    margin-bottom: 36px;
}

/* ── Card / form box ──────────────────────────── */
.card-form {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10), 0 0 2px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #212121;
}

/* ── Field group ──────────────────────────────── */
.field-group label {
    display: block;
    font-size: 13px;
    color: #9E9E9E;
    margin-bottom: 6px;
}

.input-wrap {
    display: flex;
    align-items: center;
    background: #FAFAFA;
    border: 1.5px solid #E0E0E0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.input-wrap:focus-within { border-color: #64B5F6; }
.input-error-wrap        { border-color: #EF5350 !important; }

.input-icon {
    padding: 0 12px;
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.input-wrap input,
.input-wrap select {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 12px 14px 0;
    background: transparent;
    font-size: 14px;
    color: #212121;
}

.input-wrap select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239E9E9E' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── Alerts ───────────────────────────────────── */
.alert {
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin: 14px 0;
    line-height: 1.4;
}

.alert-error   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.alert-warning { background: #FFF3E0; color: #E65100; border: 1px solid #FFCC80; }
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }

/* ── Primary button ───────────────────────────── */
.btn-primary {
    width: 100%;
    height: 56px;
    background: #1565C0;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.btn-primary:hover:not(:disabled)  { background: #1976D2; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled              { background: #90CAF9; cursor: not-allowed; }

/* ── Back button ──────────────────────────────── */
.btn-back {
    width: 100%;
    height: 48px;
    background: transparent;
    color: #1565C0;
    border: 1.5px solid #1565C0;
    border-radius: 14px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
    transition: background 0.2s;
}
.btn-back:hover { background: #E3F2FD; }

/* ── Link button ──────────────────────────────── */
.btn-link {
    background: none;
    border: none;
    color: #1565C0;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

a { color: #1565C0; }

/* ── Spinner ──────────────────────────────────── */
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.spinner.dark {
    width: 36px;
    height: 36px;
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-width: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Terms ────────────────────────────────────── */
.terms-text {
    text-align: center;
    font-size: 12px;
    color: #BDBDBD;
    line-height: 1.6;
    margin-top: 24px;
}

/* ── OTP page ─────────────────────────────────── */
.otp-icon-box {
    width: 60px;
    height: 60px;
    background: #E3F2FD;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 20px;
}

.otp-boxes {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 36px 0 28px;
}

.otp-box {
    width: 48px;
    height: 58px;
    border: 1.5px solid #E0E0E0;
    border-radius: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    background: #FAFAFA;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    caret-color: transparent;
}

.otp-box:focus {
    border-color: #1565C0;
    background: #fff;
}

.resend-row {
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
    color: #757575;
    min-height: 24px;
}

.countdown-text strong { color: #1565C0; }

/* ── Booking page ─────────────────────────────── */
.booking-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px 48px;
    min-height: 100vh;
}

.booking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.booking-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-logout {
    background: none;
    border: none;
    cursor: pointer;
    color: #9E9E9E;
    padding: 6px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.btn-logout:hover { color: #212121; background: #F5F5F5; }

/* ── Spacing utilities ────────────────────────── */
.mt-14 { margin-top: 14px; }
.mt-18 { margin-top: 18px; }
.mt-20 { margin-top: 20px; }
.mt-28 { margin-top: 28px; }

/* ── Error UI ─────────────────────────────────── */
#blazor-error-ui {
    background: #FFE082;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 10px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 10px;
    font-size: 18px;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 480px) {
    .otp-box   { width: 42px; height: 52px; font-size: 20px; }
    .otp-boxes { gap: 7px; }
}

/* ── Booking Success page ─────────────────────── */
.success-status-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 20px 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    margin-bottom: 20px;
    text-align: center;
}

.success-pulse-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: rgba(21, 101, 192, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: pulse-ring 1.8s ease-in-out infinite;
}

.success-pulse-dot {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1565C0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { box-shadow: 0 0 0 0 rgba(21, 101, 192, 0.25); }
    50%       { box-shadow: 0 0 0 14px rgba(21, 101, 192, 0); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

.success-title {
    font-size: 22px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 6px;
}

.success-subtitle {
    font-size: 15px;
    color: #1565C0;
    font-weight: 600;
    margin-bottom: 10px;
}

.success-phone {
    font-size: 13px;
    color: #757575;
}

.trip-label {
    font-size: 11px;
    color: #9E9E9E;
    margin-bottom: 2px;
}

.trip-value {
    font-size: 14px;
    color: #212121;
    font-weight: 500;
    line-height: 1.4;
}

/* ── History page ─────────────────────────────── */
.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.history-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.history-empty-text {
    font-size: 17px;
    font-weight: 700;
    color: #424242;
    margin-bottom: 6px;
}

.history-empty-sub {
    font-size: 13px;
    color: #9E9E9E;
}

.history-count {
    font-size: 13px;
    color: #9E9E9E;
    margin-bottom: 12px;
}

.history-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 14px;
}

.history-card-time {
    font-size: 12px;
    color: #9E9E9E;
    margin-bottom: 10px;
}

.history-card-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.history-icon {
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.history-card-text {
    font-size: 14px;
    color: #212121;
    line-height: 1.4;
}

.history-card-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F0F0F0;
    font-size: 12px;
    color: #757575;
}

.mt-6 { margin-top: 6px; }
