/* =============================================
   ParkMe SRL – Main Stylesheet
   Brand: #7B1040 (dark crimson), #9B3060 (mid), #B8547E (light)
   Font: Plus Jakarta Sans (EN) / Cairo (AR)
   ============================================= */

:root {
    --brand-dark:   #7B1040;
    --brand-mid:    #9B3060;
    --brand-light:  #C4688A;
    --brand-pale:   #F5E8EE;
    --accent-blue:  #1A73E8;
    --success:      #27AE60;
    --warning:      #F39C12;
    --danger:       #E74C3C;
    --text-primary: #1A1A2E;
    --text-muted:   #6B7280;
    --border:       #E5E7EB;
    --bg-page:      #F8F5F7;
    --bg-card:      #FFFFFF;
    --shadow-card:  0 4px 24px rgba(123,16,64,0.08), 0 1px 4px rgba(0,0,0,0.06);
    --radius-card:  20px;
    --radius-btn:   12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ─────────────────────────────────── */
.app-header {
    background: #fff;
    border-bottom: 2px solid var(--brand-pale);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(123,16,64,0.06);
}

.header-inner {
    height: 64px;
}

.brand-link { display: flex; align-items: center; text-decoration: none; }
.brand-logo { height: 40px; width: auto; object-fit: contain; }

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-pale);
    border-radius: 30px;
    padding: 4px 10px;
}

.lang-btn {
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn.active {
    background: var(--brand-dark);
    color: #fff;
}

.lang-divider { color: var(--brand-light); font-size: 16px; }

/* ── MAIN ────────────────────────────────────── */
.app-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px 40px;
}

/* ── SCREEN CARD ─────────────────────────────── */
.page-screen {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    animation: fadeSlideUp 0.4s ease both;
}

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

.screen-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    padding: 28px 24px 32px;
    border: 1px solid rgba(123,16,64,0.06);
}

/* ── STEP INDICATOR ─────────────────────────── */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 24px;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s;
}

.step.active {
    background: var(--brand-dark);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(123,16,64,0.15);
    transform: scale(1.1);
}

.step.done {
    background: var(--success);
    color: #fff;
}

.step-line {
    flex: 1;
    height: 3px;
    background: var(--border);
    max-width: 28px;
    min-width: 8px;
}

.step-line.done { background: var(--success); }

/* ── PARKING P ICON ─────────────────────────── */
.parking-p-icon {
    width: 60px;
    height: 60px;
    background: var(--brand-dark);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -2px;
    box-shadow: 0 4px 16px rgba(123,16,64,0.3);
    user-select: none;
}

/* ── TITLES ─────────────────────────────────── */
.screen-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-dark);
    line-height: 1.3;
}

.screen-title-ar {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ── QR SCAN HINT ───────────────────────────── */
.qr-scan-hint {
    background: var(--brand-pale);
    border-radius: 14px;
    padding: 14px 16px;
}

.qr-label {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-dark);
}

.qr-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── PLATE INPUT ─────────────────────────────── */
.plate-input-group {
    display: flex;
    align-items: stretch;
    border: 2.5px solid var(--brand-dark);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.plate-input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(123,16,64,0.15);
}

.plate-country-badge {
    background: var(--brand-dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    gap: 2px;
    flex-shrink: 0;
}

.country-flag { font-size: 18px; }
.country-code { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }

.plate-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: 'Plus Jakarta Sans', monospace;
    width: 100%;
    min-width: 0;
}

.plate-input::placeholder { color: var(--border); font-weight: 400; letter-spacing: 2px; }

.plate-example {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── BUTTONS ─────────────────────────────────── */
.btn-primary-parkme {
    background: var(--brand-dark);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary-parkme:hover, .btn-primary-parkme:focus {
    background: var(--brand-mid);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(123,16,64,0.3);
}

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

.btn-outline-secondary {
    border: 2px solid var(--border);
    border-radius: var(--radius-btn);
    background: transparent;
    color: var(--text-muted);
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-outline-secondary:hover { border-color: var(--brand-light); color: var(--brand-dark); }

/* ── DETAILS TABLE ──────────────────────────── */
.details-table {
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.detail-label-ar { font-size: 11px; color: var(--brand-light); }

.detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* ── AMOUNT DUE CARD ────────────────────────── */
.amount-due-card {
    background: linear-gradient(135deg, var(--brand-pale) 0%, #FCE8F0 100%);
    border: 2px solid var(--brand-light);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.amount-label {
    font-size: 13px;
    color: var(--brand-dark);
    font-weight: 600;
    margin-bottom: 4px;
}

.amount-value {
    font-size: 38px;
    font-weight: 900;
    color: var(--brand-dark);
    margin: 0;
    line-height: 1.1;
}

.amount-currency { font-size: 20px; }

/* ── VEHICLE IMAGE CARD ─────────────────────── */
.vehicle-image-card {
    background: linear-gradient(160deg, #EBF3FB 0%, #F5F8FF 100%);
    border: 1.5px solid #D0E4F7;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.vehicle-image-wrap { max-width: 320px; margin: 0 auto; }
.vehicle-svg { width: 100%; height: auto; }

.plate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 2px solid var(--brand-dark);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

/* ── LOCATION CARD ──────────────────────────── */
.location-card {
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.location-card-header {
    background: var(--brand-dark);
    color: #fff;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.location-card-body { padding: 16px; }

.location-facility {
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    font-weight: 600;
}

.location-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
}

.loc-item {
    background: var(--brand-pale);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.loc-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loc-value {
    font-size: 15px;
    font-weight: 900;
    color: var(--brand-dark);
}

/* ── PAYMENT METHOD BUTTONS ─────────────────── */
.payment-method-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.apple-pay-btn {
    background: #000;
    color: #fff;
}

.apple-pay-btn:hover { background: #1a1a1a; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

.google-pay-btn {
    background: #fff;
    color: #3C4043;
    border: 2px solid var(--border) !important;
}

.google-pay-btn:hover { background: #F8F9FA; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.card-btn {
    background: var(--brand-pale);
    color: var(--brand-dark);
    border: 2px solid var(--brand-light) !important;
    font-size: 15px;
}

.card-btn:hover { background: var(--brand-dark); color: #fff; }

.divider-or {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.divider-or::before, .divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── CARD FORM ──────────────────────────────── */
.card-form-box {
    background: var(--bg-page);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 20px;
}

.form-control-parkme {
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', monospace;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control-parkme:focus {
    border-color: var(--brand-dark);
    box-shadow: 0 0 0 3px rgba(123,16,64,0.12);
    outline: none;
}

.bilingual-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.amount-summary-bar {
    background: var(--brand-pale);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-dark);
    margin-top: 16px;
}

/* ── SUCCESS SCREEN ─────────────────────────── */
.success-icon-wrap {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto;
}

.success-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #fff;
    position: relative;
    z-index: 2;
    animation: successPop 0.5s cubic-bezier(0.68,-0.55,0.27,1.55) both;
}

@keyframes successPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.success-ripple {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 3px solid var(--success);
    opacity: 0;
    animation: ripple 1.5s ease-out 0.5s infinite;
}

.success-ripple.delay1 { animation-delay: 1s; }

@keyframes ripple {
    from { opacity: 0.6; transform: scale(1); }
    to   { opacity: 0; transform: scale(1.5); }
}

.success-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--success);
}

.success-title-ar {
    font-size: 18px;
    color: var(--text-muted);
}

.exit-notice-card {
    background: #EAF7EF;
    border: 2px solid var(--success);
    border-radius: 14px;
    padding: 18px 20px;
}

.exit-icon { font-size: 24px; color: var(--success); }

.exit-notice-text {
    font-size: 15px;
    font-weight: 600;
    color: #1A5C36;
    margin-bottom: 4px;
}

.exit-notice-ar {
    font-size: 14px;
    color: #2E8A55;
    margin-bottom: 0;
}

/* ── TRANSACTION SUMMARY ────────────────────── */
.txn-summary {
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    text-align: left;
}

.txn-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.txn-row:last-child { border-bottom: none; }

.txn-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.txn-value { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.txn-value.mono { font-family: monospace; font-size: 12px; }
.amount-paid { color: var(--success); font-size: 16px; }

/* ── EXIT TIMER ─────────────────────────────── */
.exit-timer {
    background: var(--brand-pale);
    border-radius: 14px;
    padding: 16px;
}

.timer-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }

.timer-display {
    font-size: 40px;
    font-weight: 900;
    color: var(--brand-dark);
    font-family: monospace;
    letter-spacing: 3px;
    line-height: 1;
}

.timer-warning { color: var(--warning) !important; animation: pulse 1s infinite; }
.timer-expired { color: var(--danger) !important; }

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

/* ── MODALS ─────────────────────────────────── */
.search-modal-content {
    border: none;
    border-radius: 20px;
    overflow: hidden;
}

.search-spinner-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.circular-loader {
    position: absolute;
    inset: 0;
    border: 4px solid var(--border);
    border-top-color: var(--brand-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.search-spinner-wrap .parking-p-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 50px; height: 50px;
    font-size: 24px;
}

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

.faceid-modal-content {
    border: none;
    border-radius: 20px;
}

.faceid-icon-wrap {
    animation: faceIdPulse 1.5s ease-in-out infinite;
}

@keyframes faceIdPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.amount-confirm-badge {
    display: inline-block;
    background: var(--brand-dark);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    padding: 10px 24px;
    border-radius: 30px;
}

/* ── GLOBAL LOADER ──────────────────────────── */
.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-content { text-align: center; }

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid var(--brand-pale);
    border-top-color: var(--brand-dark);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

.loader-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--brand-dark);
}

/* ── FOOTER ─────────────────────────────────── */
.app-footer {
    background: var(--brand-dark);
    color: #fff;
    padding: 24px 16px;
}

.footer-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    margin-bottom: 8px;
    filter: brightness(0) invert(1);
    opacity: 0.85;
}

.footer-tagline {
    font-size: 13px;
    opacity: 0.75;
    margin-bottom: 4px;
}

.footer-copy { font-size: 11px; opacity: 0.5; margin: 0; }

/* ── ARROW ICONS for LTR/RTL ────────────────── */
body:not(.lang-ar) .arrow-icon-rtl { display: none !important; }
body.lang-ar .arrow-icon-ltr { display: none !important; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 480px) {
    .screen-card { padding: 20px 16px 24px; border-radius: 16px; }
    .amount-value { font-size: 32px; }
    .location-grid { grid-template-columns: 1fr 1fr; }
    .step { width: 26px; height: 26px; font-size: 10px; }
    .step-line { max-width: 16px; }
}

@media (min-width: 768px) {
    .app-main { padding: 40px 24px 60px; }
    .page-screen { max-width: 520px; }
    .screen-card { padding: 36px 32px 40px; }
}
