/* =============================================
  NEXOVERSE — Auth CSS
   ============================================= */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* Geometric grid lines in bg */
.auth-page::before {
  content:'';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(168,85,247,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168,85,247,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 40px rgba(168,85,247,0.08);
  position: relative;
  z-index: 1;
  animation: auth-card-in 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes auth-card-in {
  from { opacity:0; transform: translateY(30px) scale(0.97); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}
.auth-logo-image {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
}
.auth-logo-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.auth-logo-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
}
.auth-logo-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.auth-heading {
  text-align: center;
  margin-bottom: 32px;
}
.auth-heading h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  text-wrap: balance;
}
.auth-heading p { font-size: 14px; color: var(--text-secondary); }

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}
.auth-divider-line { flex:1; height:1px; background: var(--border); }
.auth-divider-text { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}
.google-primary-btn {
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(255,255,255,0.09), rgba(168,85,247,0.12));
  border-color: rgba(168,85,247,0.35);
  box-shadow: 0 0 24px rgba(168,85,247,0.12);
}
.google-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.google-primary-btn:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(168,85,247,0.16));
  border-color: rgba(168,85,247,0.5);
  box-shadow: 0 0 34px rgba(168,85,247,0.2);
}
.google-icon { font-size: 18px; }
.google-btn .btn-text { flex: 0 1 auto; }
.google-btn .btn-spinner {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.google-btn.loading .btn-text { opacity: 0; }
.google-btn.loading .btn-spinner { display: block; }

.auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(168,85,247,0.35);
}
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(168,85,247,0.5);
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth-submit .btn-text { transition: opacity var(--transition-fast); }
.auth-submit .btn-spinner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.auth-submit.loading .btn-text   { opacity: 0; }
.auth-submit.loading .btn-spinner{ display: block; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-link {
  color: var(--purple-400);
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.auth-link:hover { color: var(--purple-300, #d8b4fe); }

.role-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.role-option {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
}
.role-option:hover { border-color: rgba(168,85,247,0.4); }
.role-option.selected {
  border-color: var(--purple-500);
  background: rgba(168,85,247,0.1);
}
.role-option-icon  { font-size: 24px; margin-bottom: 8px; }
.role-option-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.role-option.selected .role-option-label { color: var(--purple-400); }

.input-error { font-size: 11px; color: #f87171; margin-top: 4px; }
.input-field.error { border-color: #f87171; }

.auth-footer,
.auth-footer a,
.input-error {
  overflow-wrap: anywhere;
}

/* Password toggle */
.password-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--text-secondary); }

@media (max-width: 480px) {
  .auth-page {
    align-items: flex-start;
    padding: 16px 16px 32px;
  }
  .auth-card { padding: 32px 24px; }
  .auth-logo-image {
    width: 58px;
    height: 58px;
  }
  .auth-logo {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    margin-bottom: 28px;
  }
  .auth-logo-subtitle {
    white-space: normal;
  }
  .auth-heading h1 {
    font-size: 22px;
  }
  .auth-divider-text {
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }
  .role-select-grid { grid-template-columns: 1fr; }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .auth-card {
    max-width: 500px;
    padding: 44px 36px;
  }
  .auth-logo-subtitle {
    white-space: normal;
  }
}

@media (min-width: 1440px) {
  .auth-card {
    max-width: 560px;
    padding: 56px 48px;
  }
}

/* Policy modal styles */
.policy-modal { display: none; position: fixed; inset: 0; z-index: 2000; }
.policy-modal[aria-hidden="false"] { display: block; }
.policy-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.policy-modal-dialog { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(920px, 96%); height: min(680px, 86%); background: var(--bg-glass); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 40px 80px rgba(0,0,0,0.6); }
.policy-modal-header { display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent); }
.policy-modal-header h3 { margin:0;font-size:16px;font-weight:700 }
.policy-modal-close { background:transparent;border:none;font-size:18px;cursor:pointer;color:var(--text-muted); }
.policy-modal-body { height: calc(100% - 56px); padding:12px; }

@media (max-width: 768px) {
  .policy-modal-dialog {
    width: min(96vw, 920px);
    height: min(90vh, 720px);
  }
}

@supports (height: 100svh) {
  .auth-page {
    min-height: 100svh;
  }
}
