/* ══════════════════════════════════════════════════════════════
   auth.css – Authentication Modal & UI (Black & White Theme)
   Matches Learning Portal's black/white monochrome design
   ══════════════════════════════════════════════════════════════ */

/* ─── Backdrop Overlay ─── */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* ─── Modal Card (Black & White) ─── */
.auth-modal-card {
  width: 100%;
  max-width: 440px;
  background: #000000;
  color: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 36px 32px 32px;
  position: relative;
  transform: translateY(16px) scale(0.97);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  overflow: hidden;
}

.auth-modal-backdrop.active .auth-modal-card {
  transform: translateY(0) scale(1);
}

/* ─── Close Button ─── */
.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #aaaaaa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  font-size: 18px;
  line-height: 1;
}

.auth-modal-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: rotate(90deg);
}

/* ─── Modal Header ─── */
.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  color: #cccccc;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: #888888;
  margin: 0;
  line-height: 1.45;
}

/* ─── Action Buttons Group ─── */
.auth-actions-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

/* Google Button */
.auth-btn-google {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  background: #ffffff;
  border: 1.5px solid #dddddd;
  color: #111111;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.auth-btn-google:hover {
  background: #f5f5f5;
  border-color: #bbbbbb;
  transform: translateY(-1px);
}

.auth-btn-google:active { transform: translateY(0); }

.auth-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* OR Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 2px 0;
  color: #555555;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-divider::before { margin-right: 10px; }
.auth-divider::after  { margin-left: 10px; }

/* Email / Continue Button */
.auth-btn-email {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  background: #ffffff;
  border: none;
  color: #000000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-email:hover {
  background: #eeeeee;
  transform: translateY(-1px);
}

.auth-btn-email:active { transform: translateY(0); }

/* ─── Form View ─── */
.auth-form-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 700;
  color: #aaaaaa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
  outline: none;
}

.auth-field input::placeholder { color: #555555; }

.auth-field input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* Submit Button in form */
.auth-btn-submit {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  background: #ffffff;
  border: none;
  color: #000000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-submit:hover {
  background: #eeeeee;
  transform: translateY(-1px);
}

.auth-btn-submit:active { transform: translateY(0); }

/* Back link */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888888;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.auth-back-link:hover { color: #ffffff; }

/* Switch mode link */
.auth-switch-mode {
  text-align: center;
  font-size: 13px;
  color: #666666;
  margin-top: 4px;
}

.auth-switch-mode a,
.auth-switch-mode button {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
}

.auth-switch-mode a:hover,
.auth-switch-mode button:hover { text-decoration: underline; }

/* ─── Forgot password ─── */
.auth-forgot-link {
  font-size: 12px;
  color: #666666;
  text-align: right;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}

.auth-forgot-link:hover { color: #ffffff; }

/* ─── Error Banner ─── */
.auth-error-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}

.auth-error-banner.show { display: block; }

/* ─── Google Setup Box ─── */
.auth-google-setup-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  margin-top: 8px;
  text-align: center;
}

.google-setup-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

/* ─── Header Sign-In Button ─── */
.header-auth-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-header-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 50px;
  background: #ffffff;
  color: #000000 !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: none;
  transition: background 0.15s, transform 0.12s;
  letter-spacing: 0.01em;
}

.btn-header-signin:hover {
  background: #eeeeee;
  transform: translateY(-1px);
}

/* ─── User Profile Pill ─── */
.user-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}

.user-profile-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.user-pill-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.user-pill-avatar.google-avatar {
  background: #ffffff;
  color: #000000;
}

/* ─── Dropdown Menu ─── */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #111111;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
}

.user-dropdown-menu.show { display: flex; }

.user-dropdown-header {
  padding: 8px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.user-dropdown-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.user-dropdown-email {
  font-size: 11px;
  color: #666666;
  margin-top: 2px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cccccc;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.user-dropdown-item.logout-item { color: #f87171; }

.user-dropdown-item.logout-item:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ─── Edit Name Modal ─── */
.edit-name-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.edit-name-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.edit-name-card {
  width: 100%;
  max-width: 400px;
  background: #000000;
  color: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  padding: 28px 24px 24px;
  position: relative;
}

.edit-name-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 20px;
}

.edit-name-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.edit-name-field label {
  font-size: 11px;
  font-weight: 700;
  color: #888888;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-name-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.edit-name-field input:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.edit-name-actions {
  display: flex;
  gap: 10px;
}

.edit-name-btn-save {
  flex: 1;
  height: 46px;
  border-radius: 9px;
  background: #ffffff;
  color: #000000;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.edit-name-btn-save:hover { background: #eeeeee; }

.edit-name-btn-cancel {
  height: 46px;
  padding: 0 20px;
  border-radius: 9px;
  background: transparent;
  color: #aaaaaa;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.edit-name-btn-cancel:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* ─── Page Lock Gate Screen ─── */
.auth-gate-wrapper {
  max-width: 520px;
  margin: 80px auto;
  padding: 48px 36px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.auth-gate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #aaaaaa;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-gate-title {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px;
}

.auth-gate-desc {
  font-size: 14px;
  color: #888888;
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ─── Password field wrapper ─── */
.auth-pwd-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-pwd-wrapper .auth-input {
  padding-right: 44px;
  width: 100%;
}

.auth-pwd-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #666666;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.auth-pwd-toggle:hover { color: #ffffff; }

/* ─── Form fields ─── */
.auth-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-email-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  box-sizing: border-box;
  outline: none;
}

.auth-input::placeholder { color: #555555; }

.auth-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.auth-form-field label {
  font-size: 12px;
  font-weight: 700;
  color: #aaaaaa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Submit & Back buttons ─── */
.auth-submit-btn {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  background: #ffffff;
  border: none;
  color: #000000;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.auth-submit-btn:hover {
  background: #eeeeee;
  transform: translateY(-1px);
}

.auth-submit-btn:active { transform: translateY(0); }

.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666666;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 10px;
  font-family: inherit;
  transition: color 0.15s;
  border-radius: 6px;
}

.auth-back-btn:hover { color: #ffffff; }

.auth-link-login {
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}

.auth-link-login:hover { text-decoration: underline; }

/* ─── Mobile Header (Only Learning Portal, Candidate Submissions, Sign In) ─── */
@media (max-width: 768px) {
  .site-header .back-btn,
  .site-header a.back-btn,
  .site-header .dmat-nav-btn,
  .site-header a[href="dmat.html"].dmat-btn-sub,
  .site-header a[href="dmat.html"],
  .site-header a[href="index.html"]:not(.logo),
  .site-header .portal-badge {
    display: none !important;
  }
  .site-header {
    padding: 6px 0 !important;
  }
  .site-header .header-inner {
    padding: 0 12px !important;
    gap: 8px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .site-header .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-left: auto !important;
  }
  .btn-header-signin {
    padding: 6px 12px !important;
    font-size: 11px !important;
    min-height: 32px !important;
  }
  .user-profile-pill {
    padding: 3px 8px 3px 4px !important;
    font-size: 11px !important;
    min-height: 32px !important;
    gap: 5px !important;
  }
  .user-profile-pill span {
    max-width: 70px !important;
    font-size: 11px !important;
  }
}
