/* صفحات المصادقة - أنا قريب */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap');

body.auth-page {
    --lp-primary: #ec6100;
    --lp-primary-dark: #c95300;
    --lp-primary-foreground: #fffaf6;
    --lp-secondary: #0c2140;
    --lp-secondary-foreground: #f7fbfd;
    --lp-bg: #fefdfa;
    --lp-card: #ffffff;
    --lp-muted: #eaf1f8;
    --lp-muted-foreground: #5a6a80;
    --lp-border: #dfe6ee;
    --lp-peach: #ffdbbf;
    --lp-cream: #fcf4e6;
    --lp-shadow-card: 0 12px 32px -14px rgba(12, 33, 64, 0.16);
    --lp-shadow-soft: 0 20px 50px -20px rgba(12, 33, 64, 0.22);
    --lp-shadow-orange: 0 14px 34px -12px rgba(236, 97, 0, 0.45);

    position: relative;
    min-height: 100vh;
    background: var(--lp-bg);
    color: var(--lp-secondary);
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', sans-serif;
    padding: 0;
    overflow-x: hidden;
}
/* صفحات مستقلة (نسيت كلمة المرور، إعادة التعيين، تأكيد الحساب) بدون تقسيم شاشة: تتوسط الصفحة رأسياً وأفقياً */
body.auth-page:not(:has(.auth-grid)) {
    display: flex; align-items: center; justify-content: center;
}
body.auth-page::before {
    content: ''; position: fixed; top: -100px; left: -100px; width: 420px; height: 420px;
    background: var(--lp-peach); opacity: 0.5; border-radius: 50%; filter: blur(80px);
    pointer-events: none; z-index: 0;
}
body.auth-page h1, body.auth-page h2, body.auth-page h3 { font-weight: 800; color: var(--lp-secondary); }

/* Buttons (scoped override of the app-wide purple .btn) */
body.auth-page .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--lp-primary); color: var(--lp-primary-foreground);
    border: none; padding: 12px 22px; border-radius: 12px;
    font-weight: 700; font-size: 14px; text-decoration: none;
    box-shadow: var(--lp-shadow-orange);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit; cursor: pointer;
}
body.auth-page .btn:hover { transform: translateY(-2px); background: var(--lp-primary-dark); }
body.auth-page .btn-block { width: 100%; padding: 14px; font-size: 15px; }

/* Layout */
.auth-shell { max-width: 620px; width: 100%; margin: 0 auto; padding: 26px 20px; position: relative; z-index: 1; }
.auth-back {
    color: var(--lp-muted-foreground); text-decoration: none;
    font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 15px;
    transition: color 0.2s;
}
.auth-back:hover { color: var(--lp-primary); }

.auth-card {
    background: var(--lp-card); border: 1px solid var(--lp-border); border-radius: 24px; padding: 44px 48px;
    box-shadow: var(--lp-shadow-soft);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img {
    height: 56px; width: auto; max-width: 200px; object-fit: contain;
    margin: 0 auto 14px; display: block;
}
.auth-brand h1 { font-size: 21px; color: var(--lp-secondary); }
.auth-brand p { color: var(--lp-muted-foreground); font-size: 13px; margin-top: 4px; }

.auth-title {
    font-size: 21px; color: var(--lp-secondary); margin-bottom: 4px; text-align: center;
}
.auth-subtitle {
    text-align: center; color: var(--lp-muted-foreground); font-size: 13px; margin-bottom: 22px;
}

/* Split layout (login/register entry page) */
.auth-grid { position: relative; z-index: 1; min-height: 100vh; }
@media (min-width: 1024px) {
    .auth-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
    .auth-grid .auth-shell { max-width: 520px; padding: 30px 40px; margin: 0; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
}

.auth-brand-side {
    display: none;
    position: relative; overflow: hidden;
    background: linear-gradient(175deg, var(--lp-cream) 0%, var(--lp-peach) 100%);
    padding: 44px 48px;
    flex-direction: column;
    justify-content: center;
}
@media (min-width: 1024px) {
    .auth-brand-side { display: flex; }
}
.auth-hello-pill {
    position: absolute; top: 28px; right: 32px;
    background: var(--lp-card); color: var(--lp-secondary); font-size: 13px; font-weight: 800;
    padding: 9px 18px; border-radius: 999px; box-shadow: var(--lp-shadow-card);
}
.auth-brand-side h2 { font-size: 30px; line-height: 1.35; margin-top: 30px; }
.auth-brand-side h2 span { color: var(--lp-primary); }
.auth-brand-side > p { margin-top: 14px; max-width: 400px; color: var(--lp-muted-foreground); font-size: 14px; line-height: 1.8; }

/* Photo + feature list side by side (photo on the reading-start side in RTL, i.e. the left) */
.auth-visual-row { margin-top: 30px; display: flex; align-items: center; gap: 24px; }
.auth-visual-photo { position: relative; flex-shrink: 0; width: 38%; max-width: 230px; }
.auth-visual-blob {
    position: absolute; inset: 8% 6% 4% 6%; border-radius: 45% 45% 50% 50% / 55% 55% 45% 45%;
    background: radial-gradient(circle at 50% 30%, var(--lp-peach) 0%, rgba(236, 97, 0, 0.15) 100%);
    z-index: 0;
}
.auth-visual-photo img {
    position: relative; z-index: 1; width: 100%; display: block;
    filter: drop-shadow(0 20px 30px rgba(12, 33, 64, 0.2));
}

.auth-features { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.auth-feature { display: flex; align-items: flex-start; gap: 12px; }
.auth-feature-text { text-align: right; }
.auth-feature-icon {
    flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
    background: var(--lp-card); color: var(--lp-secondary); box-shadow: var(--lp-shadow-card);
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.auth-feature h4 { font-size: 14px; font-weight: 800; color: var(--lp-secondary); }
.auth-feature p { font-size: 12px; color: var(--lp-muted-foreground); margin-top: 2px; line-height: 1.6; }

/* Role tabs */
.user-type-tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin-bottom: 24px;
}
.utt {
    border: 2px solid var(--lp-border); border-radius: 12px; padding: 12px 8px;
    text-align: center; cursor: pointer; transition: all 0.2s;
    font-size: 13px; font-weight: 600; user-select: none; color: var(--lp-muted-foreground);
}
.utt input { display: none; }
.utt.active { border-color: var(--lp-primary); background: rgba(236, 97, 0, 0.06); color: var(--lp-primary); font-weight: 800; }
.utt:hover { border-color: rgba(236, 97, 0, 0.4); }
.utt span { display: block; }

/* Two big choice cards (register: user / worker) */
.user-type-tabs-2 {
    grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 4px;
}
.user-type-tabs-2 .utt {
    padding: 22px 14px; border-radius: 16px; border-width: 2px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.user-type-tabs-2 .utt-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--lp-muted); color: var(--lp-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 20px;
    margin-bottom: 4px; transition: all 0.2s;
}
.user-type-tabs-2 .utt.active .utt-icon { background: var(--lp-primary); color: var(--lp-primary-foreground); }
.user-type-tabs-2 .utt strong { font-size: 15px; color: var(--lp-secondary); font-weight: 800; }
.user-type-tabs-2 .utt.active strong { color: var(--lp-primary); }
.user-type-tabs-2 .utt small { font-size: 11px; color: var(--lp-muted-foreground); font-weight: 500; }

/* Provider kind (individual / establishment-or-entity) and entity type cards */
.provider-step-label {
    font-size: 13px; font-weight: 700; color: var(--lp-secondary);
    margin: 18px 0 8px;
}
.provider-step { margin-bottom: 18px; }
.user-type-tabs-kind {
    grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 4px;
}
.user-type-tabs-entity {
    grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px;
}
.utt-sm {
    padding: 12px 6px; border-radius: 12px; border-width: 2px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.utt-sm .utt-icon {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--lp-muted); color: var(--lp-secondary);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    transition: all 0.2s;
}
.utt-sm.active .utt-icon { background: var(--lp-primary); color: var(--lp-primary-foreground); }
.utt-sm strong { font-size: 12px; color: var(--lp-secondary); font-weight: 700; }
.utt-sm.active strong { color: var(--lp-primary); }

/* Register form: revealed only after a choice is made */
.register-form {
    max-height: 0; opacity: 0; overflow: hidden; visibility: hidden; pointer-events: none;
    margin-top: 0;
    transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.5s ease, visibility 0s linear 0.5s;
}
.register-form.revealed {
    max-height: 2600px; opacity: 1; visibility: visible; pointer-events: auto;
    margin-top: 26px;
    transition: max-height 0.6s ease, opacity 0.5s ease 0.1s, margin-top 0.6s ease;
}

/* Form fields (scoped override of the app-wide purple inputs) */
body.auth-page .form-group label { color: var(--lp-secondary); font-weight: 700; font-size: 13px; }
body.auth-page .form-group input,
body.auth-page .form-group select,
body.auth-page .form-group textarea {
    border: 2px solid var(--lp-border); border-radius: 12px; background: var(--lp-bg);
    font-family: inherit; color: var(--lp-secondary);
}
body.auth-page .form-group input:focus,
body.auth-page .form-group select:focus,
body.auth-page .form-group textarea:focus {
    border-color: var(--lp-primary); box-shadow: 0 0 0 3px rgba(236, 97, 0, 0.15);
}

/* Inputs with a leading icon (and optionally a show/hide toggle) */
.field-icon { position: relative; }
.field-icon-lead {
    position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
    color: var(--lp-muted-foreground); font-size: 15px; pointer-events: none;
}
.field-icon input { padding-right: 40px; }
.field-icon.has-toggle input { padding-left: 40px; }
.field-toggle-btn {
    position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
    background: none; border: none; color: var(--lp-muted-foreground); cursor: pointer;
    padding: 4px; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.field-toggle-btn:hover { color: var(--lp-primary); }

/* قائمة اقتراحات المدينة المنسدلة (بديل مصمَّم لـ <datalist> الافتراضية) */
.city-autocomplete { position: relative; }
.city-dropdown {
    display: none; position: absolute; top: calc(100% + 6px); right: 0; left: 0;
    background: #fff; border: 1px solid var(--lp-border); border-radius: 14px;
    box-shadow: 0 12px 32px -10px rgba(12, 33, 64, 0.25);
    max-height: 240px; overflow-y: auto; z-index: 40; padding: 6px;
}
.city-dropdown.open { display: block; }
.city-option {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 9px;
    font-size: 13.5px; color: var(--lp-secondary); cursor: pointer; transition: background 0.12s;
}
.city-option i { color: var(--lp-primary); font-size: 13px; flex-shrink: 0; }
.city-option mark { background: rgba(236, 97, 0, 0.16); color: var(--lp-primary-dark); font-weight: 700; border-radius: 3px; }
.city-option:hover, .city-option.active { background: rgba(236, 97, 0, 0.08); }
.city-dropdown .city-empty { padding: 10px 12px; font-size: 13px; color: var(--lp-muted-foreground); text-align: center; }

/* Phone: static country box + local number input */
.phone-field { display: flex; gap: 8px; }
.phone-country {
    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
    padding: 11px 12px; border: 2px solid var(--lp-border); border-radius: 12px;
    background: var(--lp-muted); color: var(--lp-secondary); font-weight: 700; font-size: 13px;
    direction: ltr;
}
.phone-field input { flex: 1; direction: ltr; text-align: right; }

.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.form-row-inline {
    display: flex; justify-content: space-between; align-items: center;
}
.checkbox { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--lp-muted-foreground); font-size: 13px; }
.checkbox input { width: auto; margin-left: 0; accent-color: var(--lp-primary); }
.terms-checkbox { align-items: flex-start; line-height: 1.7; margin: 4px 0 6px; }
.terms-checkbox input { margin-top: 3px; flex-shrink: 0; }

.auth-link { color: var(--lp-primary); text-decoration: none; font-size: 14px; font-weight: 700; }
.auth-link:hover { text-decoration: underline; }

.auth-foot {
    text-align: center; margin-top: 18px; color: var(--lp-muted-foreground); font-size: 14px;
}
.auth-foot a { color: var(--lp-primary); text-decoration: none; font-weight: 800; }

.check-ok { color: #1a9c5c; font-size: 12px; display: block; margin-top: 4px; font-weight: 600; }
.check-fail { color: #d64545; font-size: 12px; display: block; margin-top: 4px; font-weight: 600; }

/* OTP */
.otp-inputs {
    display: flex; gap: 8px; justify-content: center; margin: 25px 0;
    direction: ltr;
}
.otp-inputs input {
    width: 50px; height: 60px; text-align: center;
    font-size: 24px; font-weight: bold; font-family: 'Cairo', sans-serif;
    border: 2px solid var(--lp-border); border-radius: 12px; background: var(--lp-bg); color: var(--lp-secondary);
    outline: none; transition: border-color 0.2s;
}
.otp-inputs input:focus { border-color: var(--lp-primary); }
.otp-inputs input.filled { border-color: #1a9c5c; background: #f0fbf5; }

.otp-info {
    background: var(--lp-cream); border-radius: 14px; padding: 15px;
    text-align: center; color: var(--lp-secondary); font-size: 14px; margin-bottom: 20px;
}
.otp-info strong { color: var(--lp-primary); direction: ltr; display: inline-block; }

.otp-resend {
    text-align: center; margin-top: 15px; color: var(--lp-muted-foreground); font-size: 13px;
}
.otp-resend button {
    background: none; border: none; color: var(--lp-primary); cursor: pointer;
    font-weight: 700; font-size: 13px; padding: 0;
}
.otp-resend button:disabled { color: #aaa; cursor: not-allowed; }

.dev-hint {
    background: #fff3cd; border: 1px dashed #f39c12; padding: 10px;
    border-radius: 10px; margin-top: 20px; font-size: 12px; text-align: center;
}
.dev-hint strong { color: #856404; direction: ltr; }

@media (max-width: 540px) {
    .auth-card { padding: 26px 20px; }
    .auth-brand img { height: 46px; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .user-type-tabs { grid-template-columns: 1fr; }
    .user-type-tabs-2 { grid-template-columns: repeat(2, 1fr); }
    .user-type-tabs-kind { grid-template-columns: repeat(2, 1fr); }
    .user-type-tabs-entity { grid-template-columns: repeat(3, 1fr); }
    .otp-inputs input { width: 42px; height: 52px; font-size: 20px; }
}
