/* ==========================================================================
   Khaadify Authentication & Organization Registration Styles
   Colors strictly matching Khaadify 60:30:10 Design System:
     60% Warm Stone / Cream (#F5F3EC, #FBFAF6, #EBE9DF)
     30% Olive / Sage (#303B20, #252A20, #66783E, #DDE3C9, #EBF0DF)
     10% Muted Terracotta (#C47A3A)
   ========================================================================== */

/* Universal hidden override to prevent author display rules from overriding hidden attribute */
[hidden] {
  display: none !important;
}

body.auth-body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-main, #F5F3EC);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary, #252A20);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

.auth-page-wrapper {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* --------------------------------------------------------------------------
   Brand Header
   -------------------------------------------------------------------------- */
.auth-brand-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-logo-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-color: var(--bg-sidebar, #303B20);
  color: #FBFAF6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(48, 59, 32, 0.22);
  flex-shrink: 0;
}

.auth-logo-badge svg {
  width: 26px;
  height: 26px;
}

.auth-brand-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--bg-sidebar, #303B20);
  line-height: 1;
}

.auth-brand-tagline {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary, #5C6353);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Main Auth Card
   -------------------------------------------------------------------------- */
.auth-card {
  width: 100%;
  background-color: var(--bg-card, #FBFAF6);
  border: 1px solid var(--border-subtle, #E7E3D7);
  border-radius: 24px;
  box-shadow: 0 12px 36px -8px rgba(37, 42, 32, 0.08), 0 2px 8px rgba(37, 42, 32, 0.04);
  padding: 38px 42px 42px;
  box-sizing: border-box;
}

@media (max-width: 580px) {
  .auth-card {
    padding: 26px 22px 30px;
    border-radius: 20px;
  }
}

/* --------------------------------------------------------------------------
   Status / Alert Banner (Bulletproof display none when hidden)
   -------------------------------------------------------------------------- */
.auth-alert-banner[hidden],
.auth-alert-banner.is-hidden {
  display: none !important;
}

.auth-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 22px;
  background-color: #FDF1F1;
  border: 1px solid #F5C6C6;
  color: #B43838;
  animation: authFadeIn 0.2s ease-out;
}

.auth-alert-banner.is-success {
  background-color: #EDF7EE;
  border-color: #C8E6C9;
  color: #2E6B38;
}

.auth-alert-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.auth-alert-icon svg {
  width: 18px;
  height: 18px;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Segmented Tab Bar (Matches Volunteers Page Design System)
   -------------------------------------------------------------------------- */
.auth-tabs-nav {
  display: flex;
  background-color: var(--bg-secondary, #EBE9DF);
  border-radius: 9999px;
  padding: 5px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 20px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #5C6353);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.auth-tab-btn:hover {
  color: var(--text-primary, #252A20);
}

.auth-tab-btn.is-active {
  background-color: var(--bg-sidebar, #303B20);
  color: #FBFAF6;
  box-shadow: 0 2px 8px rgba(48, 59, 32, 0.2);
}

/* --------------------------------------------------------------------------
   Headings & Subheadings
   -------------------------------------------------------------------------- */
.auth-panel-heading {
  margin-bottom: 22px;
}

.auth-panel-heading.text-center {
  text-align: center;
}

.auth-heading {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary, #252A20);
  line-height: 1.25;
}

.auth-subheading {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary, #5C6353);
  line-height: 1.48;
}

/* --------------------------------------------------------------------------
   Form Controls
   -------------------------------------------------------------------------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary, #252A20);
  letter-spacing: -0.01em;
}

.required-star {
  color: var(--terracotta, #C47A3A);
  font-weight: 700;
  margin-left: 2px;
}

.optional-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary, #5C6353);
  background-color: var(--bg-secondary, #EBE9DF);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 6px;
  display: inline-block;
  vertical-align: middle;
}

.form-helper-text {
  margin: 5px 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: #5C6353;
  line-height: 1.4;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted, #767D6C);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.form-input {
  width: 100%;
  height: 48px;
  box-sizing: border-box;
  padding: 0 16px 0 44px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary, #252A20);
  background-color: var(--bg-inset, #F6F4EC);
  border: 1px solid var(--border-subtle, #E7E3D7);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.form-input:hover {
  border-color: #D2CDBC;
}

.form-input:focus {
  background-color: #FFFFFF;
  border-color: var(--olive, #66783E);
  box-shadow: 0 0 0 3px rgba(102, 120, 62, 0.15);
}

.form-input::placeholder {
  color: #8C9482;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Password Visibility Toggle (Ensures eye-off NEVER shows together with eye)
   -------------------------------------------------------------------------- */
.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 6px;
  color: var(--text-muted, #767D6C);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--text-primary, #252A20);
}

.password-toggle-btn svg {
  width: 17px;
  height: 17px;
}

/* Explicit toggle rules: eye-off is hidden by default; eye is hidden when active */
.password-toggle-btn .icon-eye {
  display: block !important;
}

.password-toggle-btn .icon-eye-off {
  display: none !important;
}

.password-toggle-btn.is-active .icon-eye {
  display: none !important;
}

.password-toggle-btn.is-active .icon-eye-off {
  display: block !important;
}

/* --------------------------------------------------------------------------
   Checkbox & Inline Rows
   -------------------------------------------------------------------------- */
.form-row-remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary, #5C6353);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  accent-color: var(--bg-sidebar, #303B20);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Action Buttons
   -------------------------------------------------------------------------- */
.auth-primary-btn {
  width: 100%;
  height: 50px;
  border: none;
  background-color: var(--bg-sidebar, #303B20);
  color: #FFFFFF;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px rgba(48, 59, 32, 0.2);
}

.auth-primary-btn:hover:not(:disabled) {
  background-color: #242D18;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(48, 59, 32, 0.25);
}

.auth-primary-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.auth-secondary-btn {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border-subtle, #E7E3D7);
  background-color: transparent;
  color: var(--text-primary, #252A20);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.auth-secondary-btn:hover {
  background-color: var(--bg-secondary, #EBE9DF);
}

.text-link-btn {
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--terracotta, #C47A3A);
  cursor: pointer;
}

.text-link-btn:hover {
  text-decoration: underline;
}

.text-link-btn.center-block {
  display: block;
  margin: 14px auto 0;
}

/* --------------------------------------------------------------------------
   Divider
   -------------------------------------------------------------------------- */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: var(--text-muted, #767D6C);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #E4E0D4;
}

.auth-divider span {
  padding: 0 12px;
}

/* --------------------------------------------------------------------------
   Google Button
   -------------------------------------------------------------------------- */
.auth-google-btn {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-subtle, #E7E3D7);
  background-color: #FFFFFF;
  color: var(--text-primary, #252A20);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.auth-google-btn:hover {
  background-color: var(--bg-inset, #F6F4EC);
  border-color: #D2CDBC;
}

.google-icon-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  line-height: 0 !important;
  box-sizing: border-box !important;
}

.google-icon-wrapper svg,
.auth-google-btn svg,
.auth-google-btn .google-icon,
.google-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex-shrink: 0 !important;
  display: block !important;
  vertical-align: middle !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* --------------------------------------------------------------------------
   Bottom Switch Link
   -------------------------------------------------------------------------- */
.auth-switch-text {
  margin: 22px 0 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #5C6353);
}

.auth-switch-link {
  background: transparent;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--bg-sidebar, #303B20);
  cursor: pointer;
  margin-left: 4px;
}

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

/* --------------------------------------------------------------------------
   Email Verification Panel
   -------------------------------------------------------------------------- */
.auth-verify-icon-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--sage-soft, #EBF0DF);
  color: var(--olive-deep, #465B24);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-verify-icon-box svg {
  width: 28px;
  height: 28px;
}

.auth-verify-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Registration Success Screen
   -------------------------------------------------------------------------- */
.auth-success-badge {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background-color: var(--sage-soft, #EBF0DF);
  color: var(--olive-deep, #465B24);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-success-badge svg {
  width: 34px;
  height: 34px;
}

.auth-summary-card {
  background-color: #F6F4EB;
  border: 1px solid #E6E1D3;
  border-radius: 16px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.summary-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #767D6C);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.summary-auto-badge {
  background-color: var(--sage, #DDE3C9);
  color: var(--sage-text, #3A4D22);
  padding: 2px 7px;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: none;
}

.summary-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary, #252A20);
}

.summary-id-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--terracotta, #C47A3A);
}

/* --------------------------------------------------------------------------
   Google Org Prompt Modal
   -------------------------------------------------------------------------- */
.auth-modal-box {
  max-width: 480px;
}

.modal-intro {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--text-secondary, #5C6353);
  line-height: 1.45;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
