/**
 * Top Card OTP Auth — styles
 * Matches the Top Card theme: Tajawal, ink #0c1a3a, brand blue #1a5cff, action orange #ff6a2b.
 * Every token is scoped to .t2c-auth-wrapper / .t2c-modal-overlay so nothing leaks into the theme.
 */

.t2c-auth-wrapper,
.t2c-modal-overlay {
  --t2c-ink: #0c1a3a;
  --t2c-ink-2: #3b4766;
  --t2c-muted: #6a7591;
  --t2c-line: #e5e8f0;
  --t2c-bg: #f6f7fb;
  --t2c-blue: #1a5cff;
  --t2c-blue-ink: #0f3fc4;
  --t2c-blue-soft: #ecf1ff;
  --t2c-accent: #ff6a2b;
  --t2c-accent-ink: #e4561a;
  --t2c-ok: #12a150;
  --t2c-err: #dc2626;
  --t2c-font: 'Tajawal', 'Segoe UI', system-ui, sans-serif;
}

.t2c-auth-wrapper {
  font-family: var(--t2c-font);
  direction: rtl;
  text-align: right;
  color: var(--t2c-ink);
  line-height: 1.6;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}
.t2c-auth-wrapper *,
.t2c-auth-wrapper *::before,
.t2c-auth-wrapper *::after { box-sizing: border-box; }

/* account page while logged out: hide the theme's page title */
body.woocommerce-account:not(.logged-in) .entry-title,
body.woocommerce-account:not(.logged-in) .page-title,
body.woocommerce-account:not(.logged-in) .entry-header { display: none !important; }

/* ───────── card ───────── */
.t2c-auth-card {
  background: #fff;
  border-radius: 28px;
  padding: 28px 28px 26px;
  box-shadow: 0 1px 2px rgba(12, 26, 58, .04), 0 18px 40px -18px rgba(12, 26, 58, .22);
  position: relative;
}

.t2c-auth-brand { display: flex; justify-content: center; margin: -6px 0 10px; line-height: 0; }
.t2c-auth-brand img { height: 56px; width: auto; max-width: 170px; object-fit: contain; }

.t2c-panel-heading { text-align: center; margin-bottom: 20px; }
.t2c-panel-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  border-radius: 16px; background: var(--t2c-blue-soft); color: var(--t2c-blue);
  display: flex; align-items: center; justify-content: center;
}
.t2c-panel-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.t2c-heading-title { font-family: var(--t2c-font); font-size: 22px; font-weight: 800; color: var(--t2c-ink); margin: 0 0 4px; line-height: 1.35; }
.t2c-heading-desc { font-size: 14px; color: var(--t2c-muted); margin: 0; line-height: 1.7; }

.t2c-auth-panel { display: none; }
.t2c-auth-panel.active { display: block; animation: t2cFadeIn .18s ease-out; }
@keyframes t2cFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ───────── fields ───────── */
.t2c-auth-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.t2c-form-group { display: flex; flex-direction: column; gap: 6px; }
.t2c-form-label { font-size: 13.5px; font-weight: 700; color: var(--t2c-ink); }
.t2c-input-wrapper { position: relative; display: flex; align-items: center; }

.t2c-auth-wrapper .t2c-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  margin: 0;
  background: var(--t2c-bg);
  color: var(--t2c-ink);
  border: 1.5px solid var(--t2c-line);
  border-radius: 14px;
  font: 500 15px/1 var(--t2c-font);
  outline: none;
  box-shadow: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.t2c-auth-wrapper .t2c-input[dir="ltr"] { text-align: left; }
.t2c-auth-wrapper .t2c-input[dir="ltr"]::placeholder { text-align: left; }
.t2c-auth-wrapper .t2c-input::placeholder { color: #9aa4ba; }
.t2c-auth-wrapper .t2c-input:hover { border-color: #c9d0e0; background: #fff; }
.t2c-auth-wrapper .t2c-input:focus { border-color: var(--t2c-blue); background: #fff; box-shadow: 0 0 0 4px var(--t2c-blue-soft); }
.t2c-auth-wrapper .t2c-input[type="password"] { letter-spacing: .12em; }
.t2c-auth-wrapper .t2c-input[type="password"]::placeholder { letter-spacing: normal; }

.t2c-has-toggle .t2c-input { padding-left: 48px; }
.t2c-password-toggle {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0 !important; margin: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--t2c-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.t2c-password-toggle:hover { background: #fff; color: var(--t2c-ink); }
.t2c-password-toggle:focus-visible { outline: 2px solid var(--t2c-blue); outline-offset: 0; }

/* honeypot */
.t2c-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; left: -9999px; }

.t2c-form-footer-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.t2c-checkbox-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--t2c-ink-2); cursor: pointer; margin: 0; }
.t2c-auth-wrapper .t2c-checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--t2c-blue); cursor: pointer; }

.t2c-link { color: var(--t2c-blue) !important; font-size: 13.5px; font-weight: 700; text-decoration: none !important; cursor: pointer; }
.t2c-link:hover { color: var(--t2c-blue-ink) !important; text-decoration: underline !important; }
.t2c-switch-line { text-align: center; margin: 2px 0 0; font-size: 13.5px; color: var(--t2c-muted); }

/* ───────── buttons ───────── */
.t2c-auth-wrapper .t2c-btn {
  width: 100%;
  height: 50px;
  padding: 0 20px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--t2c-accent);
  color: #fff !important;
  font: 800 15.5px/1 var(--t2c-font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s ease, transform .1s ease;
}
.t2c-auth-wrapper .t2c-btn:hover { background: var(--t2c-accent-ink); }
.t2c-auth-wrapper .t2c-btn:active { transform: translateY(1px); }
.t2c-auth-wrapper .t2c-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.t2c-auth-wrapper .t2c-btn-outline { background: transparent; color: var(--t2c-ink) !important; border: 1.5px solid var(--t2c-line); }
.t2c-auth-wrapper .t2c-btn-outline:hover { background: var(--t2c-bg); border-color: var(--t2c-ink); }
.t2c-auth-actions { display: flex; flex-direction: column; gap: 10px; }

.t2c-divider { display: flex; align-items: center; gap: 12px; margin: 2px 0; color: #9aa4ba; font-size: 12.5px; }
.t2c-divider::before, .t2c-divider::after { content: ''; flex: 1; height: 1px; background: var(--t2c-line); }

.t2c-btn-google {
  width: 100%; height: 50px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: var(--t2c-ink) !important; border: 1.5px solid var(--t2c-line);
  font: 700 14.5px/1 var(--t2c-font); text-decoration: none !important;
  transition: border-color .15s ease, background-color .15s ease;
}
.t2c-btn-google:hover { border-color: var(--t2c-ink); background: var(--t2c-bg); }

.t2c-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  display: inline-block; animation: t2cSpin .7s linear infinite;
}
@keyframes t2cSpin { to { transform: rotate(360deg); } }

/* ───────── code entry ───────── */
.t2c-otp-container { display: flex; justify-content: center; gap: 8px; margin: 4px 0 6px; direction: ltr; }
.t2c-auth-wrapper .t2c-otp-input {
  width: 50px; height: 58px; padding: 0; margin: 0;
  text-align: center;
  font: 800 24px/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--t2c-ink);
  background: var(--t2c-bg);
  border: 1.5px solid var(--t2c-line);
  border-radius: 14px;
  outline: none;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.t2c-auth-wrapper .t2c-otp-input:focus { border-color: var(--t2c-blue); background: #fff; box-shadow: 0 0 0 4px var(--t2c-blue-soft); }
.t2c-auth-wrapper .t2c-otp-input.filled { border-color: var(--t2c-blue); background: var(--t2c-blue-soft); color: var(--t2c-blue-ink); }

.t2c-verify-email-display {
  display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 999px;
  background: var(--t2c-bg); color: var(--t2c-ink); font-weight: 700; font-size: 13.5px;
}
.t2c-otp-resend-wrap { text-align: center; font-size: 13.5px; color: var(--t2c-muted); }
.t2c-otp-timer { font-weight: 800; color: var(--t2c-ink); font-variant-numeric: tabular-nums; }
.t2c-resend-btn {
  background: none; border: 0; padding: 0 !important; cursor: pointer;
  color: var(--t2c-blue); font: 800 13.5px/1.6 var(--t2c-font); text-decoration: underline;
}
.t2c-resend-btn:disabled { color: var(--t2c-muted); cursor: not-allowed; text-decoration: none; }

/* ───────── alerts ───────── */
.t2c-alert {
  display: none; margin: 0 0 14px; padding: 11px 14px;
  border-radius: 14px; font-size: 13.5px; line-height: 1.7; border: 0;
}
.t2c-alert.show { display: block; }
.t2c-alert-success { background: #e9f7ef; color: #0d7a3c; }
.t2c-alert-error   { background: #fdecec; color: #b42318; }
.t2c-alert-warning { background: #fff0e8; color: #b8460f; }
.t2c-alert-info    { background: var(--t2c-blue-soft); color: var(--t2c-blue-ink); }

/* ───────── popup ───────── */
.t2c-modal-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(12, 26, 58, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.t2c-modal-overlay.active { display: flex; }
.t2c-modal-container { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; border-radius: 28px; }
.t2c-modal-close {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  width: 36px; height: 36px; padding: 0 !important; border: 0; border-radius: 50%;
  background: var(--t2c-bg); color: var(--t2c-ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.t2c-modal-close:hover { background: var(--t2c-ink); color: #fff; }

.t2c-auth-modal-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px;
  border: 0; border-radius: 999px; background: #1a5cff; color: #fff !important;
  font: 700 14px/1 'Tajawal', sans-serif; text-decoration: none !important; cursor: pointer;
}
.t2c-auth-modal-btn:hover { background: #0f3fc4; }

.t2c-wc-login-wrapper { margin: 24px auto 40px; }

@media (max-width: 480px) {
  .t2c-auth-card { padding: 22px 18px 20px; border-radius: 24px; }
  .t2c-heading-title { font-size: 20px; }
  .t2c-otp-container { gap: 6px; }
  .t2c-auth-wrapper .t2c-otp-input { width: 44px; height: 52px; font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  .t2c-auth-wrapper *, .t2c-modal-overlay * { transition: none !important; animation: none !important; }
}
