@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

.fr-wrap {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    direction: rtl;
    max-width: 600px;
    margin: 1.5rem auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    border: 1px solid #e8e4dc;
}

/* HEADER */
.fr-header {
    background: linear-gradient(135deg, #c0392b 0%, #96281b 55%, #1a6fa8 100%);
    padding: 1.4rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.fr-header::before {
    content: '';
    position: absolute; top: -30px; left: -30px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
}
.fr-header-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(255,255,255,0.25);
    flex-shrink: 0;
    position: relative; z-index: 1;
}
.fr-header-title {
    font-size: 1.05rem; font-weight: 700; color: #fff;
    position: relative; z-index: 1;
}
.fr-header-sub {
    font-size: 0.75rem; color: rgba(255,255,255,0.7);
    margin-top: 3px;
    position: relative; z-index: 1;
}

/* BODY */
.fr-body { padding: 1.5rem 1.75rem; }

/* NOTICE */
.fr-notice {
    display: flex; align-items: center; gap: 8px;
    background: #eaf4ff; color: #0c447c;
    border: 1px solid #b8d4e8;
    border-radius: 10px; padding: 0.65rem 1rem;
    font-size: 0.78rem; margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* FIELD */
.fr-field {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px dashed #f0ede6;
}
.fr-field:last-of-type { border-bottom: none; }

.fr-label {
    font-size: 0.9rem; font-weight: 600; color: #1a1a2e;
    margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.fr-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: #c0392b; color: #fff;
    font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.fr-hint {
    font-size: 0.72rem; color: #aaa; font-weight: 400;
}

/* GENDER TABS */
.fr-gender-tabs {
    display: flex; gap: 6px; margin-bottom: 0.75rem;
}
.fr-gtab {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.78rem; font-weight: 600;
    padding: 5px 16px; border-radius: 20px;
    border: 1.5px solid #e2e0d9;
    background: #fafaf8; color: #888;
    cursor: pointer; transition: all 0.15s;
}
.fr-gtab.active {
    background: #1a6fa8; color: #fff; border-color: #1a6fa8;
}

/* OPTIONS */
.fr-options { display: flex; flex-direction: column; gap: 8px; }
.fr-options.hidden { display: none; }

.fr-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 0.65rem 1rem;
    border: 1.5px solid #e8e4dc;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.84rem; color: #444;
    font-weight: 400;
}
.fr-opt:hover { border-color: #c0392b; background: #fff5f5; }
.fr-opt input[type="radio"] {
    width: 18px; height: 18px;
    accent-color: #c0392b;
    flex-shrink: 0;
}
.fr-opt.selected {
    border-color: #c0392b;
    background: #fff5f5;
    color: #c0392b;
    font-weight: 500;
}

/* SUBMIT BUTTON */
.fr-btn {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    width: 100%; background: #c0392b; color: #fff;
    border: none; border-radius: 12px;
    padding: 0.95rem; font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 0.15s, transform 0.15s;
    margin-top: 0.5rem;
    box-shadow: 0 4px 14px rgba(192,57,43,0.3);
}
.fr-btn:hover { background: #96281b; transform: translateY(-1px); }

/* RESULT */
.fr-result { animation: frFadeIn 0.4s ease; }
.fr-result.hidden { display: none; }
@keyframes frFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.fr-result-score-row {
    display: flex; gap: 16px; align-items: stretch;
    margin-bottom: 1.25rem;
}
.fr-result-score-box {
    background: #1a1a2e;
    border-radius: 16px; padding: 1.25rem 1.5rem;
    text-align: center; flex-shrink: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.fr-result-score-label { font-size: 0.68rem; color: rgba(255,255,255,0.5); margin-bottom: 0.3rem; }
.fr-result-score-val { font-size: 2.8rem; font-weight: 700; color: #fff; line-height: 1; }
.fr-result-score-max { font-size: 0.68rem; color: rgba(255,255,255,0.35); margin-top: 2px; }

.fr-result-info {
    flex: 1;
    border: 2px solid #e8e4dc;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
}
.fr-result-level { font-size: 1.1rem; font-weight: 700; }
.fr-result-prob  { font-size: 0.8rem; color: #888; }
.fr-result-desc  { font-size: 0.75rem; color: #bbb; }

/* BAR */
.fr-result-bar-wrap { margin-bottom: 1.25rem; }
.fr-result-bar {
    height: 10px; background: #f0ede6; border-radius: 10px;
    overflow: hidden; margin-bottom: 6px;
}
.fr-result-bar-fill {
    height: 100%; border-radius: 10px;
    transition: width 0.8s cubic-bezier(.4,0,.2,1), background 0.4s;
    width: 0%;
}
.fr-result-bar-labels {
    display: flex; justify-content: space-between;
    font-size: 0.65rem; color: #bbb;
}

/* ADVICE */
.fr-result-advice {
    border-radius: 12px; padding: 1rem 1.1rem;
    font-size: 0.82rem; line-height: 1.8;
    margin-bottom: 1rem;
}

.fr-result-disclaimer {
    font-size: 0.72rem; color: #bbb;
    text-align: center; margin-bottom: 1rem;
    background: #fafaf8; border-radius: 8px; padding: 0.5rem 0.75rem;
    border: 1px solid #f0ede6;
}

.fr-retry-btn {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    width: 100%; background: #fafaf8; color: #555;
    border: 1.5px solid #e2e0d9; border-radius: 10px;
    padding: 0.75rem; font-size: 0.88rem; font-weight: 500;
    cursor: pointer; transition: background 0.15s;
}
.fr-retry-btn:hover { background: #f0ede6; }

/* FOOTER */
.fr-footer {
    text-align: center;
    font-size: 0.72rem; color: #ccc;
    padding: 0.85rem;
    border-top: 1px solid #f0ede6;
    background: #fafaf8;
}

/* MOBILE */
@media (max-width: 480px) {
    .fr-body { padding: 1.2rem 1.1rem; }
    .fr-result-score-row { flex-direction: column; }
    .fr-result-score-box { padding: 1rem; }
}
