/* ==========================================================
   style.css - dark RTL theme (matches the reference screens)
   ========================================================== */

/* Optional: upload Vazirmatn-Regular.woff2 / Vazirmatn-Bold.woff2 into a "fonts" folder.
   If the files are missing, the browser simply uses Tahoma / system fonts. */
@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Vazirmatn";
    src: url("fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --bg:            #0e0e16;
    --surface:       #1e1e20;
    --surface-2:     #26272b;
    --header-bg:     #1b1b1d;
    --border:        #3a3a40;
    --border-soft:   #2f3037;
    --text:          #e6e9f5;
    --muted:         #9ca3af;
    --muted-2:       #6b7280;
    --navy:          #000080;
    --indigo:        #818cf8;
    --purple:        #c084fc;
    --green:         #34d399;
    --green-light:   #6ee7b7;
    --green-bg:      #04281a;
    --pink:          #f472b6;
    --red-bg:        #3a1c24;
    --red-text:      #fda4af;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(40, 40, 110, .25), transparent 60%),
        radial-gradient(700px 500px at 0% 100%, rgba(30, 20, 70, .30), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    overflow-x: hidden;              /* no sideways scrolling */
}

/* ---------- Header ---------- */
.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-soft);
}
.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 14px 15px;
    display: flex;
    flex-wrap: wrap;                 /* on phones the logout button drops to the next line */
    align-items: center;
    gap: 12px 16px;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-icon {
    flex: none;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    font-size: 20px;
    background: var(--navy);
    border-radius: 12px;
    box-shadow: 0 0 18px rgba(99, 102, 241, .35);
}
.brand-title { font-size: 19px; font-weight: 700; }

.logout-form { margin: 0; }
.btn-logout {
    display: inline-flex; align-items: center; gap: 10px;
    font: inherit; font-size: 15px; font-weight: 700;
    color: var(--pink);
    background: #54444a;
    border: 1px solid #6a5058;
    border-radius: 999px;
    padding: 9px 16px;
    cursor: pointer;
}
.btn-logout:hover { background: #5f4a52; }

/* ---------- Layout ---------- */
.container { max-width: 1000px; margin: 0 auto; padding: 24px 15px 48px; }
.container-narrow { max-width: 520px; padding-top: 32px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(99, 102, 241, .10);
}

/* ---------- Login ---------- */
.login-card { padding: 30px; text-align: center; }
.login-icon {
    width: 60px; height: 60px;
    margin: 6px auto 16px;
    display: grid; place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #00005a, #1c0044);
    box-shadow: 0 0 26px rgba(99, 102, 241, .35);
}
.login-title { margin: 0 0 10px; font-size: 27px; font-weight: 700; }
.login-text  { margin: 0 0 26px; font-size: 16px; color: var(--muted); line-height: 2; }

.login-card form { text-align: right; }
.field-label { display: block; margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.field-input {
    display: block; width: 100%;
    height: 52px;
    padding: 0 16px;
    font: inherit; font-size: 18px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid #44454c;
    border-radius: 20px;
    outline: none;
}
.field-input::placeholder { color: var(--muted-2); }
.field-input:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, .25);
}
.field-hint { margin: 10px 4px 22px; font-size: 13.5px; color: var(--muted-2); }

.btn-primary {
    display: block; width: 100%;
    height: 54px;
    font: inherit; font-size: 18px; font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #00005a 0%, #1c0044 50%, #00005a 100%);
    border: 0;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(60, 60, 200, .28);
}
.btn-primary:hover { filter: brightness(1.2); }
.btn-primary:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }

.alert-error {
    margin: 0 0 20px;
    padding: 12px 16px;
    font-size: 15px;
    text-align: right;
    color: var(--red-text);
    background: var(--red-bg);
    border: 1px solid #6b2d3a;
    border-radius: 16px;
}

/* ---------- Welcome card ---------- */
.welcome-card { padding: 30px 22px; text-align: center; margin-bottom: 26px; }
.badge-pill {
    display: inline-block;
    padding: 6px 18px;
    font-size: 13.5px; font-weight: 700;
    color: #a5b4fc;
    background: #14183a;
    border: 1px solid #1e2350;
    border-radius: 999px;
}
.welcome-title { margin: 18px 0 8px; font-size: 28px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.welcome-text  { margin: 0 auto; max-width: 560px; font-size: 16px; color: var(--muted); line-height: 2; }
.welcome-icon {
    width: 74px; height: 74px;
    margin: 28px auto 4px;
    display: grid; place-items: center;
    font-size: 38px;
    border-radius: 24px;
    background: linear-gradient(135deg, #2d1c0c, #241524);
    border: 1px solid #4a4a50;
}

/* ---------- Accepted box ---------- */
.stat-card {
    display: flex; align-items: center; gap: 16px;
    padding: 18px;
    margin-bottom: 26px;
    background: var(--surface);
    border: 1px solid #2f5f4f;
    border-radius: 30px;
}
.stat-icon {
    flex: none;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    font-size: 26px; font-weight: 700;
    color: var(--green);
    background: var(--green-bg);
    border-radius: 15px;
}
.stat-number { font-size: 30px; font-weight: 700; line-height: 1.2; color: var(--green-light); }
.stat-label  { font-size: 15px; font-weight: 700; color: var(--green); }

/* ---------- Section cards ---------- */
.section-card { padding: 24px 23px; margin-bottom: 26px; }
.section-title {
    display: flex; align-items: center; gap: 12px;
    margin: 0 0 6px;
    font-size: 21px; font-weight: 700;
}
.section-sub { margin: 0; font-size: 14.5px; color: var(--muted-2); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0 22px; }
.dot { flex: none; width: 13px; height: 13px; border-radius: 50%; }
.dot-blue   { background: var(--indigo); box-shadow: 0 0 10px rgba(129, 140, 248, .6); }
.dot-purple { background: var(--purple); box-shadow: 0 0 10px rgba(192, 132, 252, .6); }

/* ---------- Candidate information ---------- */
/* Phone layout: name, phone and province each take a full row,
   then the three scores sit together in one row of three. */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.info-item {
    min-width: 0;
    padding: 12px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
}
.info-item:nth-child(-n+3) { grid-column: 1 / -1; padding: 14px 16px; }  /* first 3 = full width */
.info-label { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; line-height: 1.6; }
.info-value { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.info-item:nth-child(-n+3) .info-label { font-size: 13.5px; }
.info-item:nth-child(-n+3) .info-value { font-size: 18px; }

/* ---------- Fields table ---------- */
.fields-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fields-table th {
    padding: 0 6px 16px;
    font-size: 14px; font-weight: 400;
    color: var(--muted);
    text-align: right;
    border-bottom: 1px solid var(--border);
}
.fields-table td {
    padding: 16px 6px;
    font-size: 17px; font-weight: 700;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    overflow-wrap: anywhere;
}
.fields-table tbody tr:last-child td { border-bottom: 0; }
.fields-table td.col-priority { font-weight: 400; color: var(--muted); font-size: 18px; }
.col-priority { width: 20%; }
.col-result   { width: 36%; }
.col-title    { width: 44%; }

.badge-accepted {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px;
    font-size: 14px; font-weight: 700;
    color: var(--green-light);
    background: var(--green-bg);
    border-radius: 999px;
    white-space: nowrap;
}
.badge-accepted::after {
    content: "";
    width: 5px; height: 12px;
    background: var(--green-light);
    border-radius: 3px;
}

.empty-note { margin: 0; text-align: center; color: var(--muted); }

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 640px) {
    .container { padding-top: 32px; }
    .info-grid { gap: 14px; }
    .info-item,
    .info-item:nth-child(-n+3) { grid-column: auto; padding: 14px 16px; }   /* back to 3 equal columns */
    .info-label,
    .info-item:nth-child(-n+3) .info-label { font-size: 13.5px; }
    .info-value,
    .info-item:nth-child(-n+3) .info-value { font-size: 18px; }
    .section-card { padding: 28px 30px; }
    .welcome-title { font-size: 32px; }
}

@media (min-width: 900px) {
    .stat-card { max-width: 360px; }
}

/* ---------- Very small phones ---------- */
@media (max-width: 360px) {
    .brand-title   { font-size: 17px; }
    .login-card    { padding: 24px 18px; }
    .info-item     { padding: 10px 8px; }
    .info-value    { font-size: 15px; }
    .fields-table td { font-size: 15px; }
    .badge-accepted  { padding: 5px 10px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
