/* ============================================================
   ASSURE SUCCESS — Candidate account pages
   Login / Sign Up / My Account
   Loads AFTER style.css and reuses its colours and buttons.
   ============================================================ */

/* ── Signed-in chip in the navigation bar ───────────────────── */
.as-userchip {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border: 1px solid var(--border);
  border-radius: 50px; cursor: pointer; background: var(--white);
  transition: all .25s; outline: none;
}
.as-userchip:hover, .as-userchip:focus-within { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.as-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: var(--primary); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; overflow: hidden;
  font-family: 'Poppins', sans-serif;
}
.as-avatar img { width: 100%; height: 100%; object-fit: cover; }
.as-uname { font-size: 14px; font-weight: 600; color: var(--primary); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-userchip svg { color: var(--text-light); transition: transform .25s; }

.as-menu {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 230px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all .22s; z-index: 1200;
}
.as-userchip:hover .as-menu, .as-userchip:focus-within .as-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.as-userchip:hover svg, .as-userchip:focus-within svg { transform: rotate(180deg); }
.as-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.as-menu-head strong { display: block; font-size: 14px; color: var(--primary); font-family: 'Poppins', sans-serif; }
.as-menu-head span { display: block; font-size: 12px; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; }
.as-menu a {
  display: block; padding: 10px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: var(--text); transition: all .2s;
}
.as-menu a:hover { background: var(--light); color: var(--primary); padding-left: 16px; }
.as-menu a[data-as-logout] { color: #c53030; }
.as-menu a[data-as-logout]:hover { background: rgba(197,48,48,.08); }

/* the mobile menu now holds two more links */
.mobile-menu.open { max-height: 680px; }

/* ── Shared page shell ──────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; padding: 70px 0 0;
  background: var(--light);
  display: flex; align-items: stretch;
}
.auth-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  width: 100%; max-width: 1180px; margin: 0 auto;
}

/* left brand panel */
.auth-brand {
  background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-mid) 100%);
  color: var(--white); padding: 64px 56px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-brand::before {
  content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,.25), transparent 68%);
  top: -120px; right: -110px;
}
.auth-brand::after {
  content: ''; position: absolute; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.09), transparent 70%);
  bottom: -100px; left: -90px;
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand h2 { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.25; margin-bottom: 16px; }
.auth-brand h2 span { color: var(--accent); }
.auth-brand p.lead { font-size: 15px; color: rgba(255,255,255,.85); line-height: 1.75; max-width: 420px; }
.auth-points { margin-top: 34px; display: flex; flex-direction: column; gap: 16px; }
.auth-point { display: flex; align-items: flex-start; gap: 13px; font-size: 14.5px; color: rgba(255,255,255,.92); }
.auth-point .tick {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(245,166,35,.2); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.auth-quote {
  margin-top: 38px; padding: 18px 20px; border-left: 3px solid var(--accent);
  background: rgba(255,255,255,.07); border-radius: 0 10px 10px 0;
  font-size: 14px; color: rgba(255,255,255,.9); line-height: 1.7;
}

/* right form panel */
.auth-panel {
  background: var(--white); padding: 56px 56px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-head { margin-bottom: 26px; }
.auth-head h1 { font-size: 27px; color: var(--primary); margin-bottom: 6px; }
.auth-head p { font-size: 14.5px; color: var(--text-light); }

/* ── Sign in / Create account switch ────────────────────────── */
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--light); padding: 5px; border-radius: 50px; margin-bottom: 26px;
}
.auth-tab {
  padding: 11px 8px; border: none; background: transparent; cursor: pointer;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14px;
  color: var(--text-light); border-radius: 50px; transition: all .25s;
}
.auth-tab.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
.auth-tab:hover:not(.active) { color: var(--primary); }

/* ── Social buttons ─────────────────────────────────────────── */
.social-stack { display: flex; flex-direction: column; gap: 11px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 13px 18px; border-radius: 50px;
  border: 1.5px solid var(--border); background: var(--white);
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 14.5px;
  color: var(--text); cursor: pointer; transition: all .25s;
}
.social-btn:hover:not(:disabled) { border-color: var(--primary); background: var(--light); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.social-btn:disabled { opacity: .45; cursor: not-allowed; }
.social-btn svg { flex: 0 0 20px; }
.social-btn.fb    { color: #1877F2; border-color: rgba(24,119,242,.35); }
.social-btn.fb:hover:not(:disabled)    { background: rgba(24,119,242,.06); border-color: #1877F2; }
.social-btn.li    { color: #0A66C2; border-color: rgba(10,102,194,.35); }
.social-btn.li:hover:not(:disabled)    { background: rgba(10,102,194,.06); border-color: #0A66C2; }
#googleBtn { display: flex; justify-content: center; min-height: 0; }
#googleBtn:empty { display: none; }

/* Holds the space while we ask the backend which buttons to show, so the
   form below does not jump when the Google button appears. */
.social-loading {
  height: 44px; border-radius: 50px;
  background: linear-gradient(90deg, var(--light) 25%, #e8edf5 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: as-shine 1.4s infinite;
}

.social-note {
  font-size: 12.5px; color: var(--text-light); text-align: center;
  margin-top: 10px; line-height: 1.6;
}

.auth-or {
  display: flex; align-items: center; gap: 14px; margin: 22px 0;
  color: var(--text-light); font-size: 12.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.4px;
}
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Form fields ────────────────────────────────────────────── */
.field { margin-bottom: 17px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--primary);
  margin-bottom: 7px; font-family: 'Poppins', sans-serif;
}
.field label .opt { color: var(--text-light); font-weight: 500; text-transform: none; }
.field input, .field select {
  width: 100%; padding: 13px 16px; font-size: 15px; font-family: 'Inter', sans-serif;
  color: var(--text); background: var(--white);
  border: 1.5px solid var(--border); border-radius: 11px; transition: all .22s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,166,35,.15);
}
.field input::placeholder { color: #a0aec0; }
.field.has-error input { border-color: #e53e3e; }
.field-msg { font-size: 12.5px; color: #e53e3e; margin-top: 6px; display: none; }
.field.has-error .field-msg { display: block; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px 10px;
  color: var(--text-light); font-size: 12px; font-weight: 600; border-radius: 8px;
}
.pw-toggle:hover { color: var(--primary); background: var(--light); }

.pw-meter { height: 4px; border-radius: 4px; background: var(--border); margin-top: 8px; overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: all .3s; border-radius: 4px; }
.pw-hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.auth-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 20px; flex-wrap: wrap;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex: 0 0 16px; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font-weight: 600; font-size: 13.5px;
  font-family: 'Inter', sans-serif; text-decoration: underline;
}
.link-btn:hover { color: var(--accent-dark); }

.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.spinner {
  width: 16px; height: 16px; border: 2px solid rgba(13,36,97,.25);
  border-top-color: var(--primary); border-radius: 50%;
  animation: as-spin .7s linear infinite; display: inline-block;
}
@keyframes as-spin { to { transform: rotate(360deg); } }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: 11px; font-size: 14px;
  margin-bottom: 18px; line-height: 1.6; display: none;
}
.alert.show { display: block; }
.alert-error   { background: rgba(229,62,62,.09); color: #9b2c2c; border: 1px solid rgba(229,62,62,.25); }
.alert-success { background: rgba(34,197,94,.10); color: #15803d; border: 1px solid rgba(34,197,94,.28); }
.alert-info    { background: rgba(13,36,97,.06); color: var(--primary); border: 1px solid rgba(13,36,97,.18); }

.auth-foot { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--text-light); line-height: 1.7; }
.auth-foot a { color: var(--primary); font-weight: 600; text-decoration: underline; }

/* ── My Account page ────────────────────────────────────────── */
.acct-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, var(--primary-mid));
  color: var(--white); padding: 120px 0 90px; position: relative; overflow: hidden;
}
.acct-hero::after {
  content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,.2), transparent 70%);
  top: -160px; right: -120px;
}
.acct-head { display: flex; align-items: center; gap: 22px; position: relative; z-index: 1; flex-wrap: wrap; }
.acct-avatar {
  width: 82px; height: 82px; border-radius: 50%; flex: 0 0 82px;
  background: var(--accent); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; font-family: 'Poppins', sans-serif;
  overflow: hidden; border: 3px solid rgba(255,255,255,.35);
}
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-head h1 { font-size: clamp(24px, 3.4vw, 33px); margin-bottom: 5px; }
.acct-head .email { font-size: 14.5px; color: rgba(255,255,255,.82); }
.acct-head .via { margin-top: 9px; }

.acct-body { padding: 0 0 80px; background: var(--light); }
.acct-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 26px;
  margin-top: -46px; position: relative; z-index: 5; align-items: start;
}
.acct-nav {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px; position: sticky; top: 88px;
}
.acct-nav button {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; border: none; background: transparent; cursor: pointer;
  border-radius: 10px; font-family: 'Poppins', sans-serif; font-weight: 600;
  font-size: 14px; color: var(--text); text-align: left; transition: all .22s;
}
.acct-nav button:hover { background: var(--light); }
.acct-nav button.active { background: var(--primary); color: var(--white); }
.acct-nav button.danger { color: #c53030; }
.acct-nav button.danger:hover { background: rgba(197,48,48,.08); }

.panel {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px; display: none;
}
.panel.active { display: block; }
.panel h2 { font-size: 21px; color: var(--primary); margin-bottom: 6px; }
.panel > p.sub { font-size: 14px; color: var(--text-light); margin-bottom: 24px; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; margin-bottom: 28px; }
.stat-box { background: var(--light); border-radius: 12px; padding: 18px 20px; border-left: 3px solid var(--accent); }
.stat-box .n { font-size: 25px; font-weight: 800; color: var(--primary); font-family: 'Poppins', sans-serif; line-height: 1.2; }
.stat-box .l { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }

.cert-list { display: flex; flex-direction: column; gap: 14px; }
.cert-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; transition: all .25s;
}
.cert-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.cert-item .course { font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--primary); font-size: 15.5px; }
.cert-item .meta { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.cert-item .code { font-family: ui-monospace, 'Courier New', monospace; font-size: 13px; color: var(--text); letter-spacing: .5px; }

.empty { text-align: center; padding: 44px 20px; color: var(--text-light); }
.empty .icon { font-size: 42px; margin-bottom: 12px; }
.empty p { font-size: 14.5px; line-height: 1.7; max-width: 380px; margin: 0 auto 18px; }

.skeleton { background: linear-gradient(90deg, var(--light) 25%, #e8edf5 50%, var(--light) 75%); background-size: 200% 100%; animation: as-shine 1.4s infinite; border-radius: 10px; height: 74px; margin-bottom: 12px; }
@keyframes as-shine { to { background-position: -200% 0; } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 940px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-brand { padding: 46px 32px; order: 2; }
  .auth-brand .auth-points, .auth-brand .auth-quote { display: none; }
  .auth-panel { padding: 40px 28px 48px; order: 1; }
  .acct-grid { grid-template-columns: 1fr; }
  .acct-nav { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px; }
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
  .auth-panel { padding: 32px 20px 44px; }
  .panel { padding: 24px 20px; }
  .cert-item { flex-direction: column; align-items: flex-start; }
  .acct-hero { padding: 104px 0 80px; }
}
