@font-face {
  font-family: Vazirmatn;
  src: url('/assets/fonts/Vazirmatn[wght].woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --navy: #0b3850;
  --blue: #12618a;
  --cyan: #1c83ad;
  --gold: #d8a72e;
  --ink: #163548;
  --muted: #6f8491;
  --line: #dce8ed;
  --surface: #ffffff;
  --background: #f2f7f9;
  --green: #1a9270;
  --danger: #b94747;
  --shadow: 0 18px 50px rgba(15, 61, 82, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--background);
  font-family: Vazirmatn, Tahoma, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.auth-page {
  min-height: 100vh;
  background: #eef5f7;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(390px, 0.92fr) minmax(520px, 1.08fr);
  min-height: 100vh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 54px clamp(35px, 5vw, 86px);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #062f45 0%, #0c577b 65%, #177ba0 100%);
}

.auth-brand,
.auth-mobile-brand,
.portal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand img,
.auth-mobile-brand img,
.portal-logo img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
}

.auth-brand span,
.portal-logo span {
  display: flex;
  flex-direction: column;
}

.auth-brand strong {
  font-size: 18px;
}

.auth-brand small {
  color: rgba(255, 255, 255, 0.7);
}

.auth-visual-copy {
  position: relative;
  z-index: 2;
  max-width: 560px;
  margin: auto 0;
}

.auth-kicker,
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-visual-copy h1 {
  margin: 8px 0 18px;
  font-size: clamp(31px, 4vw, 52px);
  line-height: 1.55;
}

.auth-visual-copy p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.77);
  font-size: 16px;
  line-height: 2;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  animation: float-orb 7s ease-in-out infinite;
}

.auth-orb-one {
  right: -110px;
  bottom: -80px;
  width: 350px;
  height: 350px;
}

.auth-orb-two {
  top: 15%;
  left: -60px;
  width: 190px;
  height: 190px;
  animation-delay: -2.5s;
}

.auth-feature-list {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-feature-list span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.07);
  font-size: 12px;
}

.auth-card-wrap {
  display: grid;
  place-items: center;
  padding: 42px;
}

.auth-card {
  width: min(100%, 470px);
  padding: 42px;
  border: 1px solid rgba(211, 226, 232, 0.8);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
  animation: card-in 0.55s ease both;
}

.auth-card-wide {
  width: min(100%, 700px);
}

.auth-mobile-brand {
  display: none;
}

.auth-card-header h2 {
  margin: 4px 0 8px;
  font-size: 28px;
}

.auth-card-header p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.portal-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.field-label {
  display: block;
  margin: 0 2px 7px;
  color: #284c5e;
  font-size: 13px;
  font-weight: 700;
}

.field-control {
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fcfd;
  transition: 0.25s ease;
}

.field-control:focus-within {
  border-color: var(--cyan);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 131, 173, 0.09);
}

.field-control input {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.password-toggle {
  padding: 5px;
  border: 0;
  cursor: pointer;
  background: transparent;
}

.primary-action,
.light-action,
.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 24px rgba(18, 97, 138, 0.22);
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-form > .primary-action {
  width: 100%;
  margin-top: 14px;
}

.primary-action:hover,
.light-action:hover,
.upload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(18, 97, 138, 0.28);
}

.auth-switch,
.back-site {
  display: block;
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.auth-switch a,
.back-site {
  color: var(--blue);
  font-weight: 800;
}

.back-site {
  margin-top: 12px;
}

.form-alert {
  margin-bottom: 18px;
  padding: 13px 16px;
  border-radius: 13px;
  line-height: 1.9;
  animation: alert-in 0.35s ease both;
}

.form-alert ul {
  margin: 0;
  padding-right: 18px;
}

.form-alert-error {
  color: #7f3030;
  background: #fff0f0;
  border: 1px solid #f0cccc;
}

.form-alert-success {
  color: #17644f;
  background: #eaf9f3;
  border: 1px solid #c4eadc;
}

.portal-shell {
  display: flex;
  min-height: 100vh;
}

.portal-sidebar {
  position: fixed;
  z-index: 30;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: 280px;
  height: 100vh;
  padding: 28px 20px 20px;
  color: #eaf5f8;
  background: linear-gradient(180deg, #07344b, #0b4f6d);
  box-shadow: -10px 0 35px rgba(7, 52, 75, 0.12);
}

.portal-logo {
  padding: 0 7px 23px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.portal-logo img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.portal-logo small,
.sidebar-user small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 20px 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar-user img,
.avatar-fallback {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 14px;
  color: var(--navy);
  background: #fff;
  font-size: 19px;
  font-weight: 900;
}

.sidebar-user div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.portal-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  transition: 0.24s ease;
}

.portal-nav a span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.portal-menu-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-nav a:hover,
.portal-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  transform: translateX(-3px);
}

.portal-nav a.active span {
  color: var(--navy);
  background: var(--gold);
}

.sidebar-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 30px;
}

.sidebar-foot a {
  padding: 10px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
}

.logout-link {
  color: #ffd5d5;
}

.sidebar-close,
.sidebar-overlay {
  display: none;
}

.portal-main {
  width: calc(100% - 280px);
  min-height: 100vh;
  margin-right: 280px;
}

.portal-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(22px, 4vw, 54px);
  border-bottom: 1px solid rgba(217, 231, 236, 0.85);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
}

.portal-topbar > div,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-weight: 900;
}

.portal-menu-button {
  display: none;
}

.site-link {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.topbar-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-weight: 900;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-content {
  width: min(100%, 1380px);
  margin: auto;
  padding: 34px clamp(20px, 4vw, 54px) 70px;
}

.welcome-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 230px;
  padding: clamp(28px, 5vw, 55px);
  overflow: hidden;
  border-radius: 27px;
  color: #fff;
  background: linear-gradient(125deg, #073b55, #126d91);
  box-shadow: var(--shadow);
}

.welcome-card::after {
  position: absolute;
  left: -70px;
  bottom: -100px;
  width: 300px;
  height: 300px;
  border: 45px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  content: '';
}

.welcome-card h1 {
  margin: 3px 0 10px;
  font-size: clamp(24px, 3vw, 38px);
}

.welcome-card p {
  margin: 0 0 21px;
  color: rgba(255, 255, 255, 0.72);
}

.light-action {
  min-height: 42px;
  color: var(--navy);
  background: #fff;
  box-shadow: none;
  font-size: 13px;
}

.completion-ring {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--progress) * 1%), rgba(255, 255, 255, 0.13) 0);
}

.completion-ring::before {
  position: absolute;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: #0b526f;
  content: '';
}

.completion-ring strong,
.completion-ring small {
  position: relative;
  z-index: 1;
}

.completion-ring strong {
  margin-top: 24px;
  font-size: 27px;
}

.completion-ring small {
  align-self: start;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}

.stats-grid article {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 61, 82, 0.045);
}

.stats-grid article div {
  display: flex;
  flex-direction: column;
}

.stats-grid strong {
  font-size: 25px;
}

.stats-grid small {
  color: var(--muted);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 15px;
  font-size: 20px;
}

.stat-icon.blue {
  color: #12618a;
  background: #e5f4fa;
}

.stat-icon.green {
  color: #168063;
  background: #e6f8f2;
}

.stat-icon.gold {
  color: #9a7416;
  background: #fff6dc;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.75fr);
  gap: 22px;
}

.panel-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 61, 82, 0.045);
}

.panel-card h2 {
  margin: 0;
  font-size: 19px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.quick-grid a {
  display: grid;
  grid-template-columns: 43px 1fr;
  gap: 2px 12px;
  padding: 15px;
  border: 1px solid #e5eef2;
  border-radius: 15px;
  transition: 0.22s ease;
}

.quick-grid a:hover {
  border-color: #bddce8;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(15, 61, 82, 0.07);
}

.quick-grid a > span {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  border-radius: 12px;
  color: var(--blue);
  background: #e9f5f9;
}

.quick-grid strong {
  font-size: 14px;
}

.quick-grid small {
  color: var(--muted);
  font-size: 11px;
}

.profile-reminder {
  color: #fff;
  background: linear-gradient(145deg, #0e617f, #0a405c);
}

.reminder-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 15px;
  color: var(--navy);
  background: var(--gold);
}

.profile-reminder p {
  color: rgba(255, 255, 255, 0.67);
  font-size: 13px;
  line-height: 2;
}

.progress-line {
  height: 7px;
  margin: 20px 0 12px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.progress-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.profile-reminder a {
  color: #f9d97c;
  font-size: 12px;
  font-weight: 800;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.page-heading h1 {
  margin: 0 0 7px;
  font-size: 28px;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.completion-badge {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--green);
  background: #e5f7f1;
  font-size: 12px;
  font-weight: 800;
}

.profile-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.avatar-card {
  position: sticky;
  top: 100px;
  text-align: center;
}

.avatar-preview {
  display: grid;
  place-items: center;
  width: 128px;
  height: 128px;
  margin: 0 auto 15px;
  overflow: hidden;
  border: 5px solid #edf5f8;
  border-radius: 38px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  font-size: 45px;
  font-weight: 900;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-card small {
  display: block;
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.upload-button {
  min-height: 41px;
  font-size: 12px;
}

.upload-button input {
  display: none;
}

.profile-form-card {
  padding: clamp(21px, 4vw, 38px);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e7eff2;
}

.form-section-title:not(:first-child) {
  margin-top: 35px;
}

.form-section-title > span {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  color: #fff;
  background: var(--blue);
  font-weight: 900;
}

.form-section-title p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.simple-input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fbfdfe;
  transition: 0.22s ease;
}

.simple-input:focus {
  border-color: var(--cyan);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(28, 131, 173, 0.08);
}

.jalali-field-note {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.account-jalali-field {
  position: relative;
}

.account-jalali-field .jalali-datepicker {
  padding-left: 45px;
  cursor: pointer;
  direction: rtl;
}

.account-jalali-field svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transform: translateY(-50%);
}

textarea.simple-input {
  resize: vertical;
}

.form-span-2 {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 28px;
}

.form-actions a {
  color: var(--muted);
  font-size: 13px;
}

.security-card {
  display: grid;
  grid-template-columns: 250px minmax(0, 520px);
  justify-content: center;
  gap: 45px;
  padding: 50px;
}

.security-illustration {
  display: grid;
  place-items: center;
  min-height: 300px;
  border-radius: 25px;
  color: var(--gold);
  background: linear-gradient(145deg, var(--navy), var(--blue));
  font-size: 78px;
}

.tabs {
  display: flex;
  gap: 7px;
  margin-bottom: 20px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.tabs button {
  padding: 10px 18px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.tabs button:hover:not(.active) {
  color: var(--blue);
  background: #edf6f9;
}

.tabs button:focus-visible {
  outline: 3px solid rgba(28, 131, 173, 0.2);
  outline-offset: 2px;
}

.tabs button.active {
  color: #fff;
  background: var(--blue);
}

.tabs span {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  margin-right: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
}

.course-tab-panel[hidden] {
  display: none !important;
}

.course-tab-panel.active {
  animation: course-panel-in 0.32s ease both;
}

.course-empty-state {
  min-height: 380px;
}

.course-empty-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.course-empty-icon-active {
  color: #a67412;
  background: #fff5d9;
}

.course-empty-icon-completed {
  color: var(--green);
  background: #e7f7f1;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 370px;
  justify-content: center;
  text-align: center;
}

.empty-state.compact {
  min-height: 260px;
}

.empty-state p {
  max-width: 540px;
  margin: 9px auto 24px;
  color: var(--muted);
  line-height: 2;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  margin-bottom: 17px;
  border-radius: 25px;
  color: var(--blue);
  background: #e9f5f9;
  font-size: 34px;
}

.certificate-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 34px;
  color: #fff;
  background: linear-gradient(125deg, #0a405c, #16769b);
}

.certificate-hero p {
  color: rgba(255, 255, 255, 0.68);
}

.certificate-seal {
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  text-align: center;
  color: #ffe39c;
  font-weight: 900;
}

.mobile-portal-nav {
  display: none;
}

.mobile-portal-nav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes float-orb {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes course-panel-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: 0.8fr 1.2fr; }
  .content-grid { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 840px) {
  .auth-shell { display: block; padding: 24px; }
  .auth-visual { display: none; }
  .auth-card-wrap { min-height: calc(100vh - 48px); padding: 0; }
  .auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 25px; color: var(--navy); font-weight: 900; }
  .auth-mobile-brand img { width: 42px; height: 42px; border-color: #e3edf1; border-radius: 13px; }
  .portal-sidebar { transform: translateX(110%); transition: transform 0.35s cubic-bezier(.22,.8,.3,1); }
  .portal-sidebar.open { transform: translateX(0); }
  .sidebar-close { position: absolute; top: 12px; left: 12px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; color: #fff; cursor: pointer; background: rgba(255,255,255,.1); font-size: 24px; }
  .sidebar-overlay { position: fixed; z-index: 25; inset: 0; display: block; visibility: hidden; opacity: 0; background: rgba(3,31,45,.52); transition: .3s ease; }
  .sidebar-overlay.open { visibility: visible; opacity: 1; }
  .portal-main { width: 100%; margin-right: 0; }
  .portal-menu-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 11px; color: var(--navy); background: #fff; }
  .profile-layout { grid-template-columns: 1fr; }
  .avatar-card { position: static; }
  .security-card { grid-template-columns: 1fr; padding: 25px; }
  .security-illustration { min-height: 150px; }
}

@media (max-width: 620px) {
  .auth-shell { padding: 0; background: #fff; }
  .auth-card-wrap { min-height: 100vh; align-items: start; }
  .auth-card { width: 100%; min-height: 100vh; padding: 28px 20px 45px; border: 0; border-radius: 0; box-shadow: none; }
  .auth-card-header h2 { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .portal-topbar { height: 66px; padding: 0 15px; }
  .site-link { display: none; }
  .portal-content { padding: 20px 14px 105px; }
  .welcome-card { align-items: flex-start; min-height: 350px; padding: 27px 22px; }
  .completion-ring { position: absolute; left: 22px; bottom: 22px; width: 105px; height: 105px; }
  .completion-ring::before { width: 82px; height: 82px; }
  .completion-ring strong { margin-top: 17px; font-size: 21px; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stats-grid article { padding: 15px; }
  .quick-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; gap: 12px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading p { line-height: 1.8; }
  .completion-badge { white-space: nowrap; }
  .profile-form-card { padding: 20px 15px; }
  .tabs { overflow-x: auto; }
  .tabs button { flex: 0 0 auto; padding: 9px 12px; }
  .certificate-hero { align-items: flex-start; padding: 25px 20px; }
  .certificate-seal { width: 74px; height: 74px; font-size: 12px; }
  .mobile-portal-nav { position: fixed; z-index: 20; right: 10px; bottom: 10px; left: 10px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; height: 68px; padding: 7px 5px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: 0 15px 40px rgba(8,48,66,.2); backdrop-filter: blur(16px); }
  .mobile-portal-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 51px; color: #718793; font-size: 19px; }
  .mobile-portal-nav small { font-size: 9px; }
  .mobile-portal-nav a.active { color: var(--blue); }
  .mobile-portal-nav .mobile-nav-main { position: relative; top: -15px; height: 63px; color: #fff; }
  .mobile-portal-nav .mobile-nav-main span { display: grid; place-items: center; width: 48px; height: 48px; border: 5px solid var(--background); border-radius: 50%; background: linear-gradient(135deg,var(--blue),var(--cyan)); box-shadow: 0 8px 20px rgba(18,97,138,.28); }
  .mobile-portal-nav .mobile-nav-main svg { width: 22px; height: 22px; stroke-width: 1.9; }
}

.portal-courses-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.portal-courses-heading .primary-action {
  border: 0;
  cursor: pointer;
}

.portal-course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.portal-course-card {
  overflow: hidden;
  border: 1px solid #dce8ed;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(11, 58, 78, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.portal-course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px rgba(11, 58, 78, 0.13);
}

.portal-course-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 10px;
  background: linear-gradient(135deg, #e8f4f7, #f8fcfd);
}

.portal-course-cover img {
  width: 100%;
  height: 100%;
  border-radius: 17px;
  object-fit: contain;
  background: #fff;
}

.portal-course-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 70, 94, 0.9);
  font-size: 11px;
  font-weight: 800;
}

.portal-course-body {
  padding: 20px;
}

.portal-course-body h2 {
  margin: 0 0 9px;
  color: var(--navy);
  font-size: 18px;
}

.portal-course-description {
  min-height: 52px;
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 12px;
}

.portal-course-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.portal-course-facts span {
  padding: 10px 11px;
  border-radius: 12px;
  color: #4c6671;
  background: #f4f9fa;
  font-size: 11px;
}

.portal-course-facts b {
  color: #183f50;
}

.portal-course-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e6eef1;
}

.portal-course-price strong {
  display: block;
  color: var(--navy);
  font-size: 20px;
}

.portal-course-price span {
  color: var(--muted);
  font-size: 10px;
}

.portal-enroll-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #0c668a, #1887ad);
  box-shadow: 0 9px 20px rgba(15, 116, 153, 0.22);
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
}

.portal-enroll-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 840px) {
  .portal-courses-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-course-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .portal-course-body {
    padding: 16px;
  }

  .portal-course-facts {
    grid-template-columns: 1fr;
  }

  .portal-course-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-enroll-button,
  .portal-course-footer form {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.payment-result-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(27, 151, 184, 0.16), transparent 32%),
    radial-gradient(circle at 85% 85%, rgba(220, 169, 54, 0.14), transparent 30%),
    #eef5f7;
}

.payment-result-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 16px;
}

.payment-result-card {
  width: min(100%, 650px);
  padding: 28px;
  border: 1px solid rgba(16, 86, 111, 0.12);
  border-radius: 30px;
  text-align: center;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(8, 57, 76, 0.14);
  animation: card-in 0.45s ease both;
}

.payment-result-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.payment-result-brand img {
  width: 42px;
  height: 42px;
  border: 1px solid #d7e6eb;
  border-radius: 13px;
  object-fit: contain;
}

.payment-result-icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin: 0 auto 18px;
  border-radius: 31px;
  color: #11815e;
  background: #e4f7f0;
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.62);
}

.payment-result-failed .payment-result-icon,
.payment-result-invalid .payment-result-icon {
  color: #bd4545;
  background: #fff0f0;
}

.payment-result-cancelled .payment-result-icon {
  color: #a67412;
  background: #fff5d9;
}

.payment-result-icon svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.payment-result-kicker {
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.payment-result-card h1 {
  margin: 8px 0;
  color: var(--navy);
  font-size: 25px;
}

.payment-result-message {
  margin: 0 auto 24px;
  color: var(--muted);
  line-height: 2;
}

.payment-receipt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #dce8ec;
  border-radius: 20px;
  background: #dce8ec;
  text-align: right;
}

.payment-receipt div {
  min-width: 0;
  padding: 14px 16px;
  background: #f8fbfc;
}

.payment-receipt span,
.payment-receipt strong {
  display: block;
}

.payment-receipt span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.payment-receipt strong {
  overflow-wrap: anywhere;
  color: #173f50;
  font-size: 13px;
}

.payment-reference {
  direction: ltr;
  text-align: right;
}

.payment-result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.payment-result-actions a {
  min-width: 170px;
  padding: 13px 18px;
  border-radius: 14px;
  font-weight: 800;
}

.payment-result-primary {
  color: #fff;
  background: linear-gradient(135deg, #0b668b, #1888ad);
  box-shadow: 0 10px 24px rgba(14, 112, 148, 0.22);
}

.payment-result-secondary {
  color: var(--navy);
  border: 1px solid #d5e4e9;
  background: #f4f9fa;
}

.payment-result-note {
  margin: 18px 0 0;
  color: #84979f;
  font-size: 10px;
}

@media (max-width: 560px) {
  .payment-result-card {
    padding: 23px 16px;
    border-radius: 24px;
  }

  .payment-result-card h1 {
    font-size: 21px;
  }

  .payment-receipt {
    grid-template-columns: 1fr;
  }

  .payment-result-actions {
    flex-direction: column;
  }

  .payment-result-actions a {
    width: 100%;
  }
}
