:root {
    --primary: #08bf9d;
    --primary-dark: #07977f;
    --primary-soft: #dff8ef;
    --primary-pale: #f1fbf7;
    --ink: #173247;
    --muted: #71838f;
    --border: #dcebe6;
    --surface: #ffffff;
    --bg: #eef7f3;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(35, 83, 74, .09);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--ink);
    font-family: IRANSans, Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at 10% 0%, rgba(104, 225, 198, .24), transparent 30%),
        radial-gradient(circle at 96% 22%, rgba(150, 237, 218, .18), transparent 24%),
        var(--bg);
}

button, input { font: inherit; }

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 42px 20px;
}

.auth-card {
    width: min(760px, 100%);
    overflow: hidden;
    border: 1px solid rgba(213, 233, 227, .96);
    border-radius: 30px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow);
}

.auth-hero {
    min-height: 180px;
    padding: 34px 38px;
    display: flex;
    align-items: center;
    gap: 22px;
    background: linear-gradient(135deg, #e9fbf6 0%, #f8fffc 52%, #e0f8f1 100%);
    border-bottom: 1px solid var(--border);
}

.medical-mark {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    border-radius: 20px;
    position: relative;
    background: linear-gradient(145deg, #5ee0c7, #09b993);
    box-shadow: 0 12px 28px rgba(7, 160, 130, .22);
}

.medical-mark.small {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 17px;
    margin: 0 auto 18px;
}

.medical-mark::before,
.medical-mark::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: white;
}

.medical-mark::before { width: 31px; height: 5px; }
.medical-mark::after { width: 5px; height: 31px; }

.eyebrow {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
}

.auth-hero h1,
.verify-head h1,
.dashboard-card h1 {
    margin: 8px 0 5px;
    font-size: 28px;
    line-height: 1.5;
    font-weight: 900;
}

.auth-hero p,
.verify-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
}

.auth-form { padding: 30px 38px 34px; }
.form-section + .form-section { margin-top: 28px; }

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 8px var(--primary-soft);
    margin: 0 7px;
}

.section-heading h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
}

.section-heading p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.role-card {
    min-height: 132px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff, #f8fcfa);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.role-card:hover {
    transform: translateY(-2px);
    border-color: rgba(8, 191, 157, .45);
}

.role-card.selected {
    border-color: rgba(8, 191, 157, .75);
    background: var(--primary-pale);
    box-shadow: 0 0 0 4px rgba(8, 191, 157, .08);
}

.role-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 21px;
    font-weight: 900;
}

.role-card strong { font-size: 14px; }
.role-card small { margin-top: 6px; color: var(--muted); font-size: 10.5px; line-height: 1.8; }

.field-label {
    display: block;
    margin: 0 4px 8px;
    color: #29434f;
    font-size: 12.5px;
    font-weight: 800;
}

.input-wrap { position: relative; }

.input-wrap input,
.otp-input {
    width: 100%;
    height: 56px;
    padding: 0 72px 0 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    outline: none;
    background: linear-gradient(180deg, #fbfefd, #f4fbf8);
    color: var(--ink);
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.input-wrap input:focus,
.otp-input:focus {
    border-color: rgba(8, 191, 157, .68);
    box-shadow: 0 0 0 4px rgba(8, 191, 157, .10);
}

.input-badge {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.primary-btn {
    width: 100%;
    min-height: 54px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #19c7a6, #079f82);
    box-shadow: 0 12px 24px rgba(7, 159, 130, .20);
    font-size: 14px;
    font-weight: 900;
}

.primary-btn:hover { filter: brightness(.98); transform: translateY(-1px); }

.field-error {
    margin: 8px 5px 0;
    color: var(--danger);
    font-size: 11.5px;
    line-height: 1.8;
}

.privacy-note {
    margin: 13px 0 0;
    color: #93a0a7;
    text-align: center;
    font-size: 10.5px;
}

.verify-card { width: min(520px, 100%); padding: 36px; }
.verify-head { text-align: center; }
.verify-form { padding: 24px 0 0; }
.otp-input {
    padding: 0 16px;
    direction: ltr;
    text-align: center;
    letter-spacing: 10px;
    font-size: 22px;
    font-weight: 900;
}

.status-message,
.dev-code {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--primary-pale);
    color: var(--primary-dark);
    text-align: center;
    font-size: 12px;
}

.dev-code { background: #fff8e6; color: #8a5b00; }
.secondary-link {
    display: block;
    margin-top: 16px;
    color: var(--primary-dark);
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.dashboard-card {
    width: min(560px, 100%);
    padding: 38px;
    text-align: center;
}
.dashboard-card .medical-mark { margin: 0 auto 18px; }
.dashboard-text { color: var(--ink); line-height: 2; }
.dashboard-text.muted { color: var(--muted); font-size: 13px; }

@media (max-width: 700px) {
    body {
        background:
            radial-gradient(circle at 12% 8%, rgba(111, 225, 199, .22), transparent 28%),
            var(--bg);
    }

    .auth-shell {
        display: block;
        padding: 0 0 26px;
    }

    .auth-card {
        width: 100%;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .login-card .auth-hero {
        min-height: 225px;
        padding: 38px 24px 68px;
        border: 0;
        border-radius: 0 0 38px 38px;
        color: #103a3a;
        background: linear-gradient(135deg, #62dfca 0%, #12c8a6 58%, #04b891 100%);
        box-shadow: 0 16px 36px rgba(7, 139, 113, .16);
    }

    .login-card .eyebrow { background: rgba(255,255,255,.75); }
    .login-card .auth-hero p { color: rgba(17, 59, 65, .72); }

    .auth-hero h1 { font-size: 25px; }
    .auth-hero .medical-mark { order: -1; width: 58px; height: 58px; flex-basis: 58px; border-radius: 19px; background: rgba(255,255,255,.94); }
    .auth-hero .medical-mark::before, .auth-hero .medical-mark::after { background: var(--primary); }

    .login-card .auth-form {
        width: calc(100% - 24px);
        margin: -40px auto 0;
        padding: 24px 16px 18px;
        border-radius: 34px;
        background: rgba(255,255,255,.98);
        box-shadow: 0 14px 36px rgba(27, 74, 67, .10);
        position: relative;
        z-index: 2;
    }

    .role-grid { grid-template-columns: 1fr; }
    .role-card {
        min-height: 92px;
        padding: 14px 16px;
        display: grid;
        grid-template-columns: 48px 1fr;
        grid-template-areas: "icon title" "icon text";
        column-gap: 12px;
        text-align: right;
        align-items: center;
    }
    .role-icon { grid-area: icon; margin: 0; }
    .role-card strong { grid-area: title; justify-self: start; }
    .role-card small { grid-area: text; justify-self: start; margin-top: 2px; }

    .verify-card,
    .dashboard-card {
        width: calc(100% - 24px);
        margin: 24px auto;
        padding: 26px 18px;
        border: 1px solid var(--border);
        border-radius: 28px;
        background: white;
        box-shadow: 0 14px 36px rgba(27, 74, 67, .10);
    }
}


/* === Rooban IRANSans auth/mobile hotfix === */
@font-face {
  font-family: "IRANSansRooban";
  src:
    url("/assets/rooban/fonts/IRANSansWeb.woff2?v=20260919-8") format("woff2"),
    url("/assets/rooban/fonts/IRANSansWeb.woff?v=20260919-8") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IRANSansRooban";
  src:
    url("/assets/rooban/fonts/IRANSansWeb_Bold.woff2?v=20260919-8") format("woff2"),
    url("/assets/rooban/fonts/IRANSansWeb_Bold.woff?v=20260919-8") format("woff");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

html,
body,
body *,
button,
input,
select,
textarea,
option {
  font-family: "IRANSansRooban", "IRANSans", Tahoma, Arial, sans-serif !important;
}

button,
input,
select,
textarea {
  font: inherit !important;
}

@media (max-width: 768px) {
  button,
  input,
  select,
  textarea,
  option {
    font-family: "IRANSansRooban", "IRANSans", Tahoma, Arial, sans-serif !important;
  }
}


/* === Mobile number field alignment fix - desktop + mobile === */
.input-wrap {
  position: relative;
  direction: ltr;
}

.input-wrap input#mobile {
  /* +98 badge is on the left, so reserve space on the LEFT. */
  padding-left: 82px !important;
  padding-right: 16px !important;
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: plaintext;
  font-variant-numeric: tabular-nums;
}

.input-wrap input#mobile::placeholder {
  direction: ltr;
  text-align: left;
  opacity: .65;
}

.input-wrap .input-badge {
  left: 10px;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  min-width: 52px;
  height: 38px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  direction: ltr;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

@media (max-width: 700px) {
  .input-wrap input#mobile {
    padding-left: 78px !important;
    padding-right: 14px !important;
  }

  .input-wrap .input-badge {
    left: 9px;
    min-width: 50px;
  }
}
