/* ============================================================
   CV Builder — واجهة الموقع
   الحركات هنا هادية بالقصد: 120-220ms وبدون قفزات،
   لأن دي أداة بتتستخدم كل يوم مش صفحة تسويقية.
   ============================================================ */

:root {
    --ink:        #14161a;
    --muted:      #6b7280;
    --line:       #e3e6ea;
    --paper:      #ffffff;
    --canvas:     #f5f6f8;
    --accent:     #1f3a5f;
    --accent-mid: #2c5488;
    --danger:     #b4232c;
    --ok-bg:      #edf7f0;
    --ok-line:    #bfe3ca;
    --radius:     10px;
    --shadow-sm:  0 1px 2px rgba(20,22,26,.06);
    --shadow-md:  0 4px 16px rgba(20,22,26,.09);
    --ease:       cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: 'Segoe UI', -apple-system, Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

/* ---------- الترويسة ---------- */
header {
    background: linear-gradient(90deg, #16324f 0%, #1f3a5f 45%, #2c5488 100%);
    border-bottom: 1px solid rgba(0,0,0,.12);
    box-shadow: 0 1px 12px rgba(20,22,26,.14);
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
}
header a {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: opacity .15s var(--ease);
}
header a:hover { color: #ffffff; opacity: .82; text-decoration: none; }

/* روابط الحساب على الشريط الملوّن */
header .navbar-nav a,
header .btn-link {
    color: rgba(255,255,255,.9);
    font-weight: 500;
}
header .navbar-nav a:hover,
header .btn-link:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.spacer { flex: 1; }

main {
    max-width: 940px;
    margin: 28px auto 60px;
    padding: 0 20px;
    animation: rise .28s var(--ease) both;
}

h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 0 0 14px; letter-spacing: -.01em; }

/* ---------- البطاقات ---------- */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d4d9e0; }

/* البطاقات بتظهر واحدة ورا التانية بفارق بسيط */
main > .card, .cv-grid > .card { animation: rise .32s var(--ease) both; }
main > .card:nth-child(2)  { animation-delay: .04s; }
main > .card:nth-child(3)  { animation-delay: .08s; }
main > .card:nth-child(4)  { animation-delay: .12s; }
main > .card:nth-child(5)  { animation-delay: .16s; }
.cv-grid > .card:nth-child(2) { animation-delay: .06s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- الحقول ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #3a3f46; }
label.check { font-weight: 400; display: flex; align-items: center; gap: 8px; margin: 12px 0; }
label.check input { width: auto; margin: 0; }

input, select, textarea {
    display: block;
    width: 100%;
    padding: 9px 11px;
    margin-bottom: 12px;
    border: 1px solid #d2d7de;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #b9c0ca; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-mid);
    box-shadow: 0 0 0 3px rgba(44,84,136,.13);
}
textarea { resize: vertical; }

/* ---------- الأزرار ---------- */
button {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 9px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
button:hover { background: var(--accent-mid); box-shadow: 0 2px 8px rgba(31,58,95,.24); }
button:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible { outline: 2px solid var(--accent-mid); outline-offset: 2px; }

/* ---------- الصفوف ---------- */
.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #eef0f3;
    padding: 9px 8px;
    margin: 0 -8px;
    border-radius: 6px;
    transition: background .15s var(--ease);
}
.row:hover { background: #fafbfc; }
.row:last-of-type { border-bottom: 0; }
.row form { display: inline; }
.row button {
    background: transparent;
    color: var(--muted);
    padding: 4px 10px;
    font-size: 12px;
    box-shadow: none;
    opacity: 0;
    transition: opacity .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.row:hover button { opacity: 1; }
.row button:hover { background: #fdeeee; color: var(--danger); box-shadow: none; }

/* على الموبايل مافيش hover، فالأزرار تفضل ظاهرة */
@media (hover: none) { .row button { opacity: 1; } }

/* ---------- الروابط ---------- */
a { color: var(--accent-mid); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.toolbar a {
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.toolbar a:hover {
    border-color: var(--accent-mid);
    background: #f7f9fc;
    color: var(--accent);
    text-decoration: none;
}
.toolbar a:active { transform: translateY(1px); }

/* ---------- عناصر متنوعة ---------- */
.badge {
    background: #eef2f8;
    color: var(--accent);
    border-radius: 20px;
    padding: 3px 11px;
    font-size: 12px;
    font-weight: 600;
}
.hint-line { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
code { background: #f1f3f5; padding: 2px 6px; border-radius: 5px; font-size: 12.5px; }

.msg {
    background: var(--ok-bg);
    border: 1px solid var(--ok-line);
    border-radius: 8px;
    padding: 11px 15px;
    margin-bottom: 18px;
    font-size: 14px;
    animation: slide-in .3s var(--ease) both;
}
@keyframes slide-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- شبكة السير ---------- */
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.cv-card { transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease); }
.cv-card:hover { transform: translateY(-2px); }
.cv-card-head { display: flex; align-items: center; gap: 10px; }
.cv-card .actions { margin-top: 14px; }

.actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 14px; }

/* ---------- قائمة الحساب ---------- */
.navbar-nav { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; align-items: center; font-size: 14px; }
.navbar-nav form { margin: 0; }
.btn-link {
    background: none;
    color: var(--accent-mid);
    padding: 0;
    font-weight: 500;
    font-size: 14px;
    box-shadow: none;
}
.btn-link:hover { background: none; text-decoration: underline; box-shadow: none; }

/* ---------- احترام تفضيل تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ---------- زرار الواتساب ---------- */
.toolbar a.wa, a.wa {
    display: inline-block;
    background: #25d366;
    border-color: #25d366;
    color: #06301a;
    font-weight: 600;
    padding: 7px 13px;
    border-radius: 8px;
    transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.toolbar a.wa:hover, a.wa:hover {
    background: #1eb555;
    border-color: #1eb555;
    color: #06301a;
    box-shadow: 0 2px 10px rgba(37,211,102,.35);
    text-decoration: none;
}
.toolbar a.wa:active, a.wa:active { transform: translateY(1px); box-shadow: none; }
a.wa-link { color: #128c3e; font-weight: 600; }


/* ============================================================
   صفحات الدخول والتسجيل (Identity)
   الصفحات دي جاهزة من المكتبة وبتستخدم كلاسات Bootstrap،
   فبنلبّسها ستايل من غير ما نعدّل كودها.
   ============================================================ */

body.auth-page {
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(44,84,136,.20), transparent 60%),
        radial-gradient(700px 500px at 110% 10%, rgba(31,58,95,.18), transparent 55%),
        var(--canvas);
    min-height: 100vh;
}

.auth-shell {
    max-width: 430px;
    margin: 0 auto;
    padding: 56px 20px 40px;
    animation: rise .34s var(--ease) both;
}

.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.auth-mark {
    width: 42px; height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #1f3a5f, #2c5488);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px; letter-spacing: .04em;
    box-shadow: 0 3px 12px rgba(31,58,95,.32);
}
.auth-name { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.auth-tag  { font-size: 12.5px; color: var(--muted); }

.auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 30px 28px 26px;
    box-shadow: 0 1px 2px rgba(20,22,26,.05), 0 10px 34px rgba(20,22,26,.09);
}

/* --- العناوين اللي جاية من المكتبة --- */
.auth-card h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.02em; }
.auth-card h2 { font-size: 13.5px; font-weight: 500; color: var(--muted); margin: 0 0 20px; }
.auth-card hr { display: none; }

/* --- إلغاء شبكة Bootstrap وإخفاء عمود الخدمات الخارجية --- */
.auth-page .row { display: block; border: 0; padding: 0; margin: 0; background: none; }
/* عمود الخدمات الخارجية: بيتخفي لو مافيش مزوّدين مضبوطين */
.auth-page .row > div + div { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-page .row > div + div h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 12px; text-align: center; }
.auth-page .row > div + div hr { display: none; }
.auth-page .row > div + div p { font-size: 13px; color: var(--muted); }

/* أزرار المزوّدين */
.auth-page .btn-provider,
.auth-page form[asp-page-handler] button,
.auth-page button[name="provider"] {
    display: block; width: 100%;
    background: #fff;
    color: var(--ink);
    border: 1px solid #d2d7de;
    border-radius: 8px;
    padding: 10px 16px;
    font-family: inherit; font-size: 14.5px; font-weight: 600;
    cursor: pointer; margin-bottom: 9px;
    box-shadow: none;
    transition: border-color .15s var(--ease), background .15s var(--ease), transform .1s var(--ease);
}
.auth-page button[name="provider"]:hover {
    background: #f7f9fc;
    border-color: var(--accent-mid);
    color: var(--accent);
    box-shadow: none;
}
.auth-page button[name="provider"]:active { transform: translateY(1px); }
.auth-page .col-md-4, .auth-page .col-md-6 { width: auto; max-width: none; }

/* --- الحقول: الليبل فوق الخانة --- */
.auth-page .form-floating { display: flex; flex-direction: column; margin-bottom: 15px; }
.auth-page .form-floating > label {
    order: -1;
    font-size: 13px; font-weight: 600; color: #3a3f46; margin-bottom: 5px;
}
.auth-page .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d2d7de;
    border-radius: 8px;
    font-family: inherit; font-size: 14px;
    background: #fff;
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.auth-page .form-control:hover { border-color: #b9c0ca; }
.auth-page .form-control:focus {
    outline: none;
    border-color: var(--accent-mid);
    box-shadow: 0 0 0 3px rgba(44,84,136,.13);
}

/* --- تذكرني --- */
.auth-page .checkbox label,
.auth-page .form-check label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.auth-page .form-check-input { width: auto; margin: 0; }

/* --- زرار الدخول --- */
.auth-page .btn-primary {
    display: block; width: 100%;
    background: var(--accent);
    color: #fff; border: 0; border-radius: 8px;
    padding: 11px 18px;
    font-family: inherit; font-size: 15px; font-weight: 600;
    cursor: pointer; margin-top: 6px;
    transition: background .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.auth-page .btn-primary:hover { background: var(--accent-mid); box-shadow: 0 3px 14px rgba(31,58,95,.28); }
.auth-page .btn-primary:active { transform: translateY(1px); box-shadow: none; }

/* --- الروابط تحت الفورم --- */
.auth-card p { margin: 0; }
.auth-card form > div:last-child {
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 9px;
    font-size: 13.5px;
}

/* --- رسائل الخطأ --- */
.auth-page .text-danger { color: var(--danger); font-size: 12.5px; display: block; margin-top: 5px; }
.auth-page .validation-summary-errors ul { margin: 0 0 14px; padding-left: 18px; }

.auth-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 22px; }


/* ---------- صفحات الدفع ---------- */
.price-card { text-align: center; padding: 30px 24px; }
.price { font-size: 40px; font-weight: 700; letter-spacing: -.03em; color: var(--accent); }
.price span { font-size: 17px; font-weight: 600; color: var(--muted); }

.ticks { list-style: none; padding: 0; margin: 18px auto; max-width: 330px; text-align: left; font-size: 14px; }
.ticks li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid #f0f2f4; }
.ticks li:last-child { border-bottom: 0; }
.ticks li::before {
    content: "✓"; position: absolute; left: 0; top: 7px;
    color: #1a7f4b; font-weight: 700;
}
.price-card button { width: 100%; max-width: 330px; padding: 12px; font-size: 15px; }

.pay-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    padding: 11px 0; border-bottom: 1px solid #f0f2f4;
}
.pay-row:last-of-type { border-bottom: 0; }
.pay-label { color: var(--muted); font-size: 13px; }
.pay-value { font-weight: 600; font-family: 'Consolas', monospace; }
.pay-value.big { font-size: 20px; color: var(--accent); }

.btn-reject { background: #fff; color: var(--danger); border: 1px solid #e6c6c8; }
.btn-reject:hover { background: #fdeeee; color: var(--danger); box-shadow: none; }

/* ==== Professional theme enhancements ==== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

.navbar, header.bg-primary, .bg-dark {
    background: linear-gradient(135deg, #1e3a5f 0%, #16324f 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.card, .border, .bg-white {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

.btn {
    border-radius: 8px !important;
    font-weight: 500;
    padding: 0.55rem 1.2rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn-primary, .btn-dark {
    background: #1e3a5f !important;
    border-color: #1e3a5f !important;
}

.btn-success {
    background: #16a34a !important;
    border-color: #16a34a !important;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #d1d5db;
    padding: 0.6rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30,58,95,0.12);
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ---------- تصميم صفحة التحرير: قائمة جانبية + أقسام قابلة للفتح ---------- */
.cv-nav-mobile { display: none; width: 100%; margin-bottom: 18px; }
.cv-shell { display: flex; gap: 24px; align-items: flex-start; }
.cv-nav { display: flex; flex-direction: column; gap: 2px; width: 210px; flex-shrink: 0; position: sticky; top: 74px; }
.cv-nav a { padding: 10px 14px; border-radius: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.cv-nav a:hover { background: #eef1f5; text-decoration: none; }
.cv-nav a.active { background: var(--accent); color: #fff; }
.cv-content { flex: 1; min-width: 0; }
.cv-panel { display: none; }
.cv-panel.active { display: block; }

@media (max-width: 900px) {
    .cv-nav { display: none; }
    .cv-nav-mobile { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-weight: 600; background: #fff; }
    .cv-shell { display: block; }
}

/* ---------- تمييز البيانات المحفوظة عن حقول الإدخال ---------- */
.row {
    background: #eef2f8;
    border: 1px solid #dde4ee;
    border-radius: 8px;
    padding: 11px 14px;
    margin-bottom: 8px;
}
.row:hover { background: #e4ebf5; border-color: var(--accent-mid); }
.row:last-of-type { margin-bottom: 18px; }

.card form:not([asp-action="SavePersonal"]):not([asp-action="SetTheme"]) {
    background: #eaf6fb;
    border: 1px solid #bfe3f0;
    border-radius: 10px;
    padding: 16px;
    margin-top: 4px;
}

.card h3 {
    display: inline-block;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--accent-mid);
    margin-bottom: 16px;
}

/* ---------- زرار اختيار وضع العرض ---------- */
.mode-select {
    width: auto !important;
    margin: 0 16px 0 0 !important;
    padding: 6px 10px !important;
    background: rgba(255,255,255,.12) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,.3) !important;
    border-radius: 6px !important;
    font-size: 13px !important;
}
.mode-select option { color: #14161a; }

/* ---------- وضع رمادي ---------- */
html[data-mode="gray"] body { background: #d9dce1; color: #1c1f24; }
html[data-mode="gray"] .card,
html[data-mode="gray"] .auth-card { background: #eceef1; }

/* ---------- وضع غامق ---------- */
html[data-mode="dark"] body { background: #14161a; color: #e7e9ec; }
html[data-mode="dark"] .card,
html[data-mode="dark"] .auth-card { background: #1e2126; border-color: #2c3038; }
html[data-mode="dark"] input,
html[data-mode="dark"] select,
html[data-mode="dark"] textarea,
html[data-mode="dark"] .form-control { background: #262a31; color: #e7e9ec; border-color: #3a3f47; }
html[data-mode="dark"] .row { background: #262c38; border-color: #333a46; }
html[data-mode="dark"] .row:hover { background: #2c3342; }
html[data-mode="dark"] a { color: #7fb0e6; }
html[data-mode="dark"] .cv-nav a { color: #e7e9ec; }
html[data-mode="dark"] .cv-nav a:hover { background: #262a31; }
html[data-mode="dark"] .toolbar a { background: #1e2126; color: #e7e9ec; border-color: #3a3f47; }
html[data-mode="dark"] code { background: #262a31; color: #e7e9ec; }
