
/* ══════════════════════════════════════════════
   AUTH / ACCOUNT / CART — ported from Ekoeduseva,
   retargeted to the Toksyto theme tokens.
═══════════════════════════════════════════════ */

.auth-hidden { display: none !important; }

/* Cart icon (header) */
.cart-link {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; color: var(--ink);
  background: var(--bg-soft); transition: background .15s ease, transform .15s ease;
}
.cart-link:hover { background: var(--border); transform: translateY(-1px); }
.cart-link svg { width: 19px; height: 19px; }
.cart-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff;
  font-family: var(--ff-body); font-size: 10.5px; font-weight: 700; line-height: 18px;
  text-align: center; box-shadow: 0 0 0 2px var(--white);
  opacity: 0; transform: scale(0.6); transition: all .15s ease; pointer-events: none;
}
.cart-badge.show { opacity: 1; transform: scale(1); }

/* Profile avatar (reused inside the account menu trigger) */
.profile-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--white);
  font-family: var(--ff-head); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* Account menu (header) — avatar + name trigger that opens a dropdown */
.account-menu { position: relative; }
.account-trigger {
  display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: 1.5px solid transparent; border-radius: 999px;
  padding: 5px 12px 5px 5px; cursor: pointer; font-family: var(--ff-body);
  transition: background .15s ease, border-color .15s ease;
}
.account-trigger:hover, .account-trigger[aria-expanded="true"] {
  background: var(--bg-soft); border-color: var(--border);
}
.account-trigger:hover .profile-avatar, .account-trigger[aria-expanded="true"] .profile-avatar {
  background: var(--primary-dark); color: #fff;
}
.account-caret { transition: transform .18s ease; flex-shrink: 0; }
.account-trigger[aria-expanded="true"] .account-caret { transform: rotate(180deg); }

.account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; min-width: 200px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  z-index: 200;
}
.account-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); padding: 10px; }
.account-dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 9px; font-family: var(--ff-body); font-size: 14px;
  font-weight: 500; color: var(--ink); background: transparent; border: none; cursor: pointer;
}
.account-dropdown-item svg { width: 17px; height: 17px; color: var(--ink-mid); flex-shrink: 0; }
.account-dropdown-item:hover { background: var(--bg-soft); }
.account-dropdown-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.account-dropdown-logout { color: var(--primary); }
.account-dropdown-logout svg { color: var(--primary); }
.account-dropdown-logout:hover { background: var(--primary-light); }

/* Google sign-in / divider */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--ink-mid); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn-slot { display: flex; justify-content: center; min-height: 42px; }
.google-btn-slot iframe { border-radius: 999px !important; }

/* Password visibility toggle */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px !important; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; padding: 6px 8px; line-height: 1;
}
.forgot-row { text-align: right; margin: -2px 0 2px; }
.forgot-row a { font-size: 13px; color: var(--primary); font-weight: 600; }
.forgot-row a:hover { text-decoration: underline; }

/* Signup — email OTP verification */
.email-verify-wrap { display: flex; gap: 8px; align-items: stretch; }
.email-verify-wrap input { flex: 1; min-width: 0; }
.btn-verify { flex-shrink: 0; padding: 0 16px; font-size: 13px; white-space: nowrap; }
.btn-verify:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.email-verified-badge {
  display: none; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
  color: var(--ink); background: var(--primary-light); border-radius: 8px;
  padding: 8px 12px; margin-top: -2px;
}
.email-verified-badge.show { display: flex; }

.otp-row { display: none; gap: 8px; align-items: stretch; margin-top: -2px; }
.otp-row.show { display: flex; }
.otp-row input { flex: 1; min-width: 0; letter-spacing: 4px; font-weight: 600; text-align: center; }
.btn-otp-confirm { flex-shrink: 0; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.btn-otp-confirm:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.otp-resend { display: none; font-size: 12.5px; color: var(--ink-mid); margin-top: -4px; }
.otp-resend.show { display: block; }
.otp-resend a { color: var(--primary); font-weight: 600; }
.otp-resend a.disabled { pointer-events: none; color: var(--ink-mid); font-weight: 500; }
.otp-resend #otpTimer { margin-left: 4px; }

#signupSubmitBtn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Login / signup / forgot-password modals */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 400;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); padding: 40px; width: 100%; max-width: 380px;
  position: relative; box-shadow: 0 30px 60px rgba(0,0,0,0.3);
  transform: translateY(10px); transition: transform .2s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal h3 { font-family: var(--ff-head); font-size: 24px; color: var(--ink); margin: 8px 0 24px; }
.modal-close { position: absolute; top: 16px; right: 18px; background: none; border: none; font-size: 22px; cursor: pointer; color: var(--ink-mid); }
#loginForm, #signupForm, #forgotForm { display: flex; flex-direction: column; gap: 12px; }
#loginForm input, #signupForm input, #forgotForm input {
  padding: 13px 16px; border-radius: 10px; border: 1.5px solid var(--border);
  font-family: var(--ff-body); background: #fff; font-size: 14.5px; width: 100%;
}
#loginForm input:focus, #signupForm input:focus, #forgotForm input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.modal-foot { text-align: center; margin-top: 18px; font-size: 13.5px; }
.modal-foot a { color: var(--primary); font-weight: 600; }
.form-error {
  background: var(--primary-light); color: var(--primary-dark); font-size: 13px; font-weight: 500;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; display: none;
}
.form-error.show { display: block; }
.form-error.info { background: var(--bg-soft); color: var(--ink-mid); }

/* Course card add-to-cart / enroll actions */
.course-card-actions .btn.added { background: #22C55E !important; border-color: #22C55E !important; color: #fff !important; }
