/* auth.css -- OCA Team Dashboard v2
   Login overlay styles. Uses design tokens from tokens.css.
   All values fall back to hard-coded defaults for resilience when
   loaded before tokens.css (should not happen in production).
*/

/* Backdrop */
#sso-auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  align-items: center;
  justify-content: center;
}

#sso-auth-overlay.sso-visible {
  display: flex;
}

.sso-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 19, 24, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Card */
.sso-card {
  position: relative;
  z-index: 1;
  background: var(--surface-0, #ffffff);
  border: 1px solid var(--border, #e8e2d2);
  border-radius: 16px;
  box-shadow: var(--shadow-pop, 0 12px 32px rgba(40,48,68,.14), 0 0 0 1px rgba(40,48,68,.06));
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 400px;
  margin: 16px;
  box-sizing: border-box;
}

/* Logo mark */
.sso-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Heading */
.sso-heading {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-1, #1a1f26);
  text-align: center;
  letter-spacing: 0;
}

/* Sub-heading */
.sso-subhead {
  margin: 0 0 24px;
  font-size: 0.875rem;
  color: var(--ink-2, #5c6068);
  text-align: center;
  line-height: 1.5;
}

/* Label */
.sso-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2, #5c6068);
}

/* Text / email / password inputs */
.sso-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong, #d9d2bf);
  border-radius: 8px;
  background: var(--surface-0, #ffffff);
  color: var(--ink-1, #1a1f26);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin-bottom: 16px;
}

.sso-input::placeholder {
  color: var(--ink-3, #8a8576);
}

.sso-input:focus {
  border-color: var(--teal, #17a398);
  box-shadow: 0 0 0 3px var(--teal-soft, #e1f3f0);
}

/* Primary button */
.sso-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 9px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.sso-btn:active { transform: scale(0.98); }
.sso-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.sso-btn-primary {
  background: var(--coral, #ef7b45);
  color: #fff;
  margin-top: 4px;
}

.sso-btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

/* Spinner (CSS-only, 16px) */
.sso-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: sso-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* Error message */
.sso-error {
  font-size: 0.8125rem;
  color: var(--red, #9f0a37);
  margin: -8px 0 12px;
  line-height: 1.4;
}

/* Sent confirmation */
.sso-sent-msg {
  font-size: 0.875rem;
  color: var(--ink-2, #5c6068);
  background: var(--teal-soft, #e1f3f0);
  border: 1px solid var(--teal, #17a398);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.sso-sent-icon {
  color: var(--teal, #17a398);
  font-weight: 700;
  margin-right: 4px;
}

/* Link-style button (toggle, resend) */
.sso-link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--teal, #17a398);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sso-link-btn:hover { opacity: 0.8; }

/* Toggle button (view switcher) */
.sso-toggle {
  display: block;
  margin: 14px auto 0;
  text-align: center;
}

/* Dark-mode adjustments */
html[data-theme="dark"] .sso-card {
  background: var(--surface-0, #161a21);
  border-color: var(--border, rgba(255,255,255,.07));
}

html[data-theme="dark"] .sso-input {
  background: var(--surface-2, #1e232c);
  color: var(--ink-1, #ede9de);
  border-color: var(--border-strong, rgba(255,255,255,.13));
}

html[data-theme="dark"] .sso-sent-msg {
  background: var(--teal-soft, rgba(34,191,177,.14));
  border-color: var(--teal, #22bfb1);
}

/* Mobile */
@media (max-width: 480px) {
  .sso-card {
    padding: 28px 20px 24px;
    border-radius: 12px;
  }

  .sso-heading {
    font-size: 1.125rem;
  }
}
