/*
|
|----------------------------------------------------------------------------------
|   EgyptDwa — tools.css
|----------------------------------------------------------------------------------
|
*/


/*
|----------------------------------------------------------------------------------
|   1) ألوان الأدوات
|----------------------------------------------------------------------------------
*/
.t-tools     { --tc: #007aff; --tc-2: #34aadc; --tc-soft: #e5f0ff; --tc-dark: #0058b8; }
.t-age       { --tc: #5856d6; --tc-2: #8e8cf0; --tc-soft: #eeeefc; --tc-dark: #3634a3; }
.t-pregnancy { --tc: #ff2d55; --tc-2: #ff7a93; --tc-soft: #ffe8ed; --tc-dark: #d6123d; }
.t-ovulation { --tc: #af52de; --tc-2: #d08cf0; --tc-soft: #f5eafb; --tc-dark: #8a2fb8; }
.t-period    { --tc: #ff3b30; --tc-2: #ff7d6e; --tc-soft: #ffeceb; --tc-dark: #d70015; }
.t-calorie   { --tc: #ff9500; --tc-2: #ffbe4d; --tc-soft: #fff4e5; --tc-dark: #c96f00; }
.t-bmi       { --tc: #34c759; --tc-2: #30b0c7; --tc-soft: #e9f8ed; --tc-dark: #1e8e3e; }
.t-growth    { --tc: #007aff; --tc-2: #5ac8fa; --tc-soft: #e5f0ff; --tc-dark: #0058b8; }


/*
|----------------------------------------------------------------------------------
|   2) هيدر الأداة + النموذج
|----------------------------------------------------------------------------------
*/
.tool-hero {
    background:
        radial-gradient(circle at 10% 15%, rgba(255, 255, 255, .22) 0, transparent 32%),
        radial-gradient(circle at 92% 90%, rgba(255, 255, 255, .16) 0, transparent 30%),
        linear-gradient(135deg, var(--tc-dark) 0%, var(--tc) 45%, var(--tc-2) 100%);
}
.tool-hero h1 { font-size: clamp(1.45rem, 4vw, 2.2rem); }
.tool-hero .lead { font-size: 1rem; opacity: .9; }
.tool-hero-ico { width: 58px; height: 58px; border-radius: 16px; place-items: center; font-size: 2rem; background: rgba(255, 255, 255, .22); }
.tool-badges { gap: .4rem; margin-top: .75rem; }
.tool-badges span { gap: .3rem; background: rgba(255, 255, 255, .2); padding: .2rem .7rem; font-size: .78rem; }

.tool-form { border-radius: 1.1rem; padding: 1.25rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.tool-form .form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.tool-form .form-text { font-size: .78rem; color: #8e8e93; }
.tool-form .form-control,
.tool-form .form-select { background-color: #f2f2f7; border: 1px solid transparent; border-radius: .75rem; min-height: 48px; font-size: 1rem; }
.tool-form .form-control:focus,
.tool-form .form-select:focus { background-color: #fff; border-color: var(--tc); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--tc) 18%, transparent); }
.tool-form .form-control.is-invalid { border-color: #ff3b30; background-image: none; padding-left: .75rem; }
.tool-form .input-group-text { background: #e9e9ef; border: 0; border-radius: .75rem; color: #3a3a3c; font-size: .85rem; min-width: 3.2rem; justify-content: center; }
.tool-form .input-group > .form-control { border-radius: 0 .75rem .75rem 0 !important; }
.tool-form .input-group > .input-group-text { border-radius: .75rem 0 0 .75rem !important; }
.tool-form .input-group > .form-control + .form-control { border-radius: 0 !important; border-right: 1px solid #e5e5ea; }
.tool-form details summary { color: var(--tc-dark); font-weight: 600; font-size: .9rem; padding: .25rem 0; }
.tool-form details summary i { transition: transform .15s ease; }
.tool-form details[open] summary i { transform: rotate(180deg); }
.tool-error { color: #d70015; font-size: .85rem; }

.btn-tool { --bs-btn-bg: var(--tc); --bs-btn-border-color: var(--tc); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--tc-dark); --bs-btn-hover-border-color: var(--tc-dark); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--tc-dark); --bs-btn-active-border-color: var(--tc-dark); --bs-btn-active-color: #fff; min-height: 52px; font-size: 1.05rem; }
.btn-tool.is-busy { pointer-events: none; opacity: .85; }
.btn-tool.is-busy i { animation: t-spin .7s linear infinite; }
@keyframes t-spin { to { transform: rotate(360deg); } }

/* أزرار مقسمة (iOS segmented control) */
.seg { display: flex; flex-wrap: wrap; background: #e9e9ef; border-radius: .8rem; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; justify-content: center; gap: .3rem; text-align: center; padding: .5rem .6rem; border-radius: .65rem; font-size: .85rem; cursor: pointer; color: #3a3a3c; transition: background-color .15s ease, color .15s ease; }
.seg label i { font-size: 1.1rem; }
.seg input:checked + label { background: #fff; color: #000; font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.seg input:checked + label i { color: var(--tc); }
.seg input:focus-visible + label { outline: 2px solid var(--tc); outline-offset: 1px; }


/*
|----------------------------------------------------------------------------------
|   3) النتائج
|----------------------------------------------------------------------------------
*/
.tool-result { scroll-margin-top: 70px; }
.tool-result:focus { outline: 0; }
.tool-result.is-in > * { animation: t-in .45s ease both; }
.tool-result.is-in > *:nth-child(2) { animation-delay: .06s; }
.tool-result.is-in > *:nth-child(3) { animation-delay: .12s; }
.tool-result.is-in > *:nth-child(4) { animation-delay: .18s; }
.tool-result.is-in > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes t-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.res-main { background: #fff; border-radius: 1.1rem; padding: 1.25rem; border-top: 5px solid var(--tc); }
.res-label { font-size: .85rem; color: #8e8e93; }
.res-big { font-size: clamp(1.7rem, 6vw, 2.5rem); font-weight: 700; line-height: 1.25; color: var(--tc-dark); }
.res-sub { font-size: .95rem; color: #3a3a3c; }
.res-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .75rem; border-radius: 50rem; font-size: .82rem; font-weight: 600; background: var(--tc-soft); color: var(--tc-dark); }
.res-note { background: var(--tc-soft); border-radius: .75rem; padding: .75rem 1rem; font-size: .92rem; }

.r-card { border-radius: .9rem; padding: 1.1rem; margin-top: .75rem; }
.r-h { gap: .55rem; font-size: 1.02rem; margin: 0 0 .85rem; }
.r-h .ios-ico { background: var(--tc); }
.r-h small { font-size: .8rem; }
.r-text { line-height: 1.85; }
.r-card .btn-light { --bs-btn-bg: #f2f2f7; --bs-btn-border-color: #f2f2f7; --bs-btn-hover-bg: #e5e5ea; --bs-btn-hover-border-color: #e5e5ea; font-weight: 600; }
.r-card .btn-light i { color: var(--tc); }

.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.kpi { background: #f2f2f7; border-radius: .75rem; padding: .7rem .8rem; }
.kpi b { display: block; font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere; }
.kpi small { display: block; color: #8e8e93; font-size: .76rem; line-height: 1.5; }
.kpi.is-hl { background: var(--tc-soft); }
.kpi.is-hl b { color: var(--tc-dark); }
@media (min-width: 768px) {
    .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.meter { height: 12px; background: #e5e5ea; border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--tc-2), var(--tc)); border-radius: 6px; }
.meter-labels { font-size: .75rem; color: #8e8e93; margin-top: .3rem; }

/* شريط مراحل (الأثلاث · مراحل الدورة) */
.stages { gap: 3px; border-radius: .6rem; }
.stages > div { padding: .5rem .4rem; font-size: .75rem; text-align: center; background: #f2f2f7; min-width: 0; }
.stages > div b { display: block; font-size: .82rem; }
.stages > div.is-now { background: var(--tc); color: #fff; }
.stages > div.is-done { background: var(--tc-soft); color: var(--tc-dark); }

/* خط زمني */
.tl li { position: relative; padding: 0 1.6rem .95rem 0; }
.tl li::before { content: ""; position: absolute; right: .42rem; top: .35rem; bottom: -.35rem; width: 2px; background: #e5e5ea; }
.tl li:last-child::before { display: none; }
.tl li::after { content: ""; position: absolute; right: .12rem; top: .3rem; width: .8rem; height: .8rem; border-radius: 50%; background: #fff; border: 2px solid #c7c7cc; }
.tl li.is-done::after { background: #c7c7cc; }
.tl li.is-now::after { background: var(--tc); border-color: var(--tc); box-shadow: 0 0 0 4px var(--tc-soft); }
.tl b { display: block; font-size: .95rem; }
.tl small { color: #8e8e93; }
.tl li.is-now b { color: var(--tc-dark); }
.tl .tl-date { font-size: .8rem; font-weight: 600; color: var(--tc-dark); }
.tl li.is-done .tl-date { color: #8e8e93; }

/* جداول النتائج */
.t-table { font-size: .88rem; }
.t-table th { color: #8e8e93; font-weight: 500; font-size: .78rem; padding: .45rem .5rem; border-bottom: 1px solid #e5e5ea; white-space: nowrap; }
.t-table td { padding: .55rem .5rem; border-bottom: .5px solid #f0f0f3; vertical-align: middle; }
.t-table tr:last-child td { border-bottom: 0; }
.t-table tr.is-now td { background: var(--tc-soft); font-weight: 600; }
.t-table tr.is-now td:first-child { border-radius: 0 .5rem .5rem 0; }
.t-table tr.is-now td:last-child { border-radius: .5rem 0 0 .5rem; }
.t-scroll { margin: 0 -.25rem; padding: 0 .25rem; }

/* تقويم ملون */
.cal-wrap { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.cal h4 { font-size: .92rem; }
.cal-grid { grid-template-columns: repeat(7, 1fr); gap: 3px; font-size: .82rem; }
.cal-grid .cal-dow { font-size: .68rem; color: #8e8e93; padding-bottom: .2rem; }
.cal-grid span { aspect-ratio: 1 / 1; display: grid; place-items: center; border-radius: 50%; position: relative; }
.cal-grid .d-period { background: #ff3b30; color: #fff; }
.cal-grid .d-period-est { background: #ffd6d3; color: #b3261e; }
.cal-grid .d-fertile { background: #efdcf9; color: #6d2591; }
.cal-grid .d-peak { background: #d6a9f0; color: #4b1466; font-weight: 700; }
.cal-grid .d-ovu { background: #af52de; color: #fff; font-weight: 700; }
.cal-grid .d-pms { background: #fff1d6; color: #9a5a00; }
.cal-grid .d-today { box-shadow: inset 0 0 0 2px #000; font-weight: 700; }
.legend { gap: .4rem 1rem; font-size: .78rem; color: #3a3a3c; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; vertical-align: -.1em; margin-left: .25rem; }

/* المئين والمقاييس */
.scale { height: 14px; border-radius: 7px; }
.scale > span { height: 100%; }
.scale-pin { height: 22px; margin-top: -2px; }
.scale-pin i { position: absolute; top: 0; transform: translateX(50%); font-size: 1.3rem; color: #000; }
.zone-ok { background: #34c759; }
.zone-warn { background: #ffcc00; }
.zone-max { background: #ff3b30; }
.tag { display: inline-block; padding: .15rem .6rem; border-radius: 50rem; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.tag-ok { background: #e3f7e8; color: #1e7b34; }
.tag-low { background: #e1f4fd; color: #0a6d95; }
.tag-warn { background: #fff6d6; color: #8a6d00; }
.tag-high { background: #ffeedb; color: #a35c00; }
.tag-max { background: #ffe5e3; color: #b3261e; }

/* SVG */
.chart { height: auto; }
.chart text { font-family: inherit; }
.chart-legend { gap: .3rem .9rem; font-size: .75rem; color: #3a3a3c; margin-top: .4rem; }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-left: .3rem; }
.donut-box svg { width: 140px; height: 140px; flex: none; }

/* الجنين هذا الأسبوع */
.fruit { width: 84px; height: 84px; background: var(--tc-soft); place-items: center; font-size: 2.6rem; }

/* قوائم صغيرة */
.dot-list li { position: relative; padding-right: 1.1rem; margin-bottom: .45rem; line-height: 1.75; }
.dot-list li::before { content: ""; position: absolute; right: 0; top: .7em; width: .45rem; height: .45rem; border-radius: 50%; background: var(--tc); }
.warn-list li::before { background: #ff3b30; }


/*
|----------------------------------------------------------------------------------
|   4) المقال · الفهرس · الأدوات الأخرى
|----------------------------------------------------------------------------------
*/
.tool-article .content h2 { scroll-margin-top: 70px; }
.tool-article .content h2::before { content: ""; display: inline-block; width: 6px; height: 1.05em; border-radius: 3px; background: var(--tc); vertical-align: -.15em; margin-left: .5rem; }
.tool-article .content table { font-size: .9rem; }
.tool-article .content .table th { background: #f2f2f7; font-weight: 600; }
.tool-article .content blockquote { background: var(--tc-soft); border-radius: .75rem; padding: .85rem 1rem; margin: 0 0 1rem; }
.toc { background: #f2f2f7; padding: .9rem 1rem; }
.toc ol { margin: .4rem 0 0; padding-right: 1.2rem; columns: 2; column-gap: 2rem; font-size: .9rem; }
.toc li { margin-bottom: .3rem; break-inside: avoid; }
.toc a { text-decoration: none; }
@media (max-width: 575.98px) {
    .toc ol { columns: 1; }
}

.tool-tile { gap: .75rem; border-radius: .9rem; padding: .9rem; }
.tool-tile b { display: block; font-size: .92rem; line-height: 1.45; }
.tool-tile small { display: block; color: #8e8e93; font-size: .78rem; line-height: 1.6; margin-top: .2rem; }

.tool-card { border-radius: 1.1rem; }
.tool-card-top { padding: 1.25rem; background: linear-gradient(135deg, var(--tc-dark) 0%, var(--tc) 50%, var(--tc-2) 100%); }
.tool-card-top i { font-size: 2.2rem; }
.tool-card-body { padding: 1rem 1.25rem 1.25rem; }


/*
|----------------------------------------------------------------------------------
|   5) الشاشات الصغيرة · الطباعة
|----------------------------------------------------------------------------------
*/
@media (max-width: 575.98px) {
    .tool-form { padding: 1rem; }
    .res-main,
    .r-card { padding: 1rem; }
    .seg label { font-size: .8rem; padding: .5rem .35rem; }
    .cal-wrap { grid-template-columns: 1fr; }
}

@media print {
    .ios-nav,
    footer,
    #menu,
    #toasts,
    .breadcrumb,
    .tool-form,
    .tool-actions,
    .tool-article,
    .tool-more,
    .ad-slot,
    .no-print { display: none !important; }
    body { background: #fff !important; }
    .tool-hero { background: none !important; color: #000 !important; padding: 0 !important; }
    .tool-hero .tool-badges,
    .tool-hero-ico { display: none !important; }
    .r-card,
    .res-main { break-inside: avoid; border: 1px solid #e5e5ea; }
    .tool-result.is-in > * { animation: none; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/*
|----------------------------------------------------------------------------------
|   6) حاسبة العمر: نتائج حيوية (ألوان · أيقونات · حلقة · مراحل · أوسمة)
|----------------------------------------------------------------------------------
|   كل القواعد هنا خاصة بـ .t-age ولا تؤثر على باقي الأدوات.
*/
.t-age .res-main {
    position: relative;
    overflow: hidden;
    border-top: 0;
    border-radius: 1.25rem;
    padding: 1.35rem;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .24) 0, transparent 34%),
        radial-gradient(circle at 8% 105%, rgba(255, 255, 255, .18) 0, transparent 42%),
        linear-gradient(135deg, var(--tc-dark) 0%, var(--tc) 55%, var(--tc-2) 100%);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--tc) 32%, transparent);
}
.t-age .res-main > * { position: relative; }
.t-age .res-deco { left: -14px; bottom: -34px; font-size: 10rem; opacity: .13; transform: rotate(-14deg); }
.t-age .res-main .res-label { color: rgba(255, 255, 255, .85); font-weight: 500; }
.t-age .res-main .res-big { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.t-age .res-main .res-sub { color: rgba(255, 255, 255, .93); }
.t-age .res-main .res-chip { background: rgba(255, 255, 255, .2); color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.t-age .res-main .res-note { background: rgba(255, 255, 255, .18); color: #fff; }
.t-age .ring { width: 132px; height: 132px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .12)); }

/* بطاقات الأرقام بأيقونات ملونة */
.t-age .kpis { gap: .55rem; }
.t-age .kpi { background: #f7f7fa; border: 1px solid #efeff4; border-radius: .9rem; padding: .75rem .8rem; }
.t-age .kpi b { font-size: 1.12rem; }
.t-age .kpi .kpi-ico { width: 34px; height: 34px; border-radius: 10px; place-items: center; font-size: 1.2rem; color: #fff; background: var(--k, var(--tc)); 
    /* box-shadow: 0 4px 12px color-mix(in srgb, var(--k, var(--tc)) 35%, transparent); */
     margin-bottom: .45rem; }
.t-age .kpi.is-hl { border-color: transparent; }
.t-age .kpi[class*="k-"]:not(.is-hl) b { color: color-mix(in srgb, var(--k) 70%, #000); }
.t-age .k-pink { --k: #ff2d55; }
.t-age .k-red { --k: #ff3b30; }
.t-age .k-orange { --k: #ff9500; }
.t-age .k-yellow { --k: #f5b400; }
.t-age .k-green { --k: #34c759; }
.t-age .k-mint { --k: #00c7be; }
.t-age .k-teal { --k: #30b0c7; }
.t-age .k-blue { --k: #007aff; }
.t-age .k-indigo { --k: #5856d6; }
.t-age .k-purple { --k: #af52de; }
.t-age .k-brown { --k: #a2845e; }
.t-age .k-gray { --k: #8e8e93; }

/* مسار المراحل العمرية */
.t-age .steps { padding: .35rem 0 .25rem; }
.t-age .step { flex: 1 1 0; font-size: .72rem; line-height: 1.35; color: #8e8e93; padding: 0 .15rem; }
.t-age .step::before { content: ""; position: absolute; top: 18px; left: 50%; width: 100%; height: 4px; background: #e5e5ea; border-radius: 2px; }
.t-age .step:first-child::before { display: none; }
.t-age .step.is-done::before,
.t-age .step.is-now::before { background: var(--tc); }
.t-age .step-dot { z-index: 1; width: 40px; height: 40px; margin: 0 auto .35rem; place-items: center; font-size: 1.15rem; background: #f2f2f7; color: #aeaeb2; border: 3px solid #fff; }
.t-age .step-label { display: block; }
.t-age .step.is-done { color: #3a3a3c; }
.t-age .step.is-done .step-dot { background: var(--tc-soft); color: var(--tc-dark); }
.t-age .step.is-now { color: var(--tc-dark); font-weight: 700; }
.t-age .step.is-now .step-dot { background: var(--tc); color: #fff; transform: scale(1.15); box-shadow: 0 0 0 5px var(--tc-soft), 0 6px 14px color-mix(in srgb, var(--tc) 40%, transparent); }
@media (max-width: 575.98px) {
    .t-age .step-dot { width: 30px; height: 30px; font-size: .95rem; border-width: 2px; }
    .t-age .step::before { top: 13px; height: 3px; }
    .t-age .steps-many .step-label { display: none; }
}

/* الأوسمة */
.t-age .badges { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .6rem; }
.t-age .medal-card { padding: .8rem .35rem .7rem; border-radius: 1rem; background: #f7f7fa; border: 1px solid #efeff4; }
.t-age .medal { width: 54px; height: 54px; margin: 0 auto .45rem; place-items: center; font-size: 1.55rem; color: #fff; background: linear-gradient(135deg, var(--m1), var(--m2)); box-shadow: 0 6px 16px color-mix(in srgb, var(--m1) 40%, transparent), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.t-age .medal-card b { display: block; font-size: .8rem; line-height: 1.4; }
.t-age .medal-card small { display: block; font-size: .7rem; color: #8e8e93; margin-top: .15rem; }
.t-age .medal-card.is-locked .medal { background: #e5e5ea; color: #aeaeb2; box-shadow: none; }
.t-age .medal-card.is-locked b { color: #8e8e93; }

/* الفحوصات والتطعيمات بأيقونات */
.t-age .icon-row { gap: .7rem; padding: .65rem 0; border-bottom: .5px solid #f0f0f3; }
.t-age .icon-row:last-child { border-bottom: 0; padding-bottom: 0; }
.t-age .icon-row .kpi-ico { width: 36px; height: 36px; border-radius: 11px; place-items: center; color: #fff; font-size: 1.2rem; background: var(--k, var(--tc)); }
.t-age .icon-row b { display: block; font-size: .93rem; }
.t-age .icon-row span { display: block; font-size: .84rem; color: #636366; line-height: 1.7; }
