/* ============================================================
   COGITATOR — AUTH STYLES
   auth.css — Login + Register screens.
   GW datasheet aesthetic — light parchment, strong headings.
   ============================================================ */

/* ----------------------------------------------------------
   APP-LEVEL STATES
   ---------------------------------------------------------- */

.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg);
}

/* ----------------------------------------------------------
   AUTH SCREEN — full-page centred layout
   ---------------------------------------------------------- */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);

  /* Subtle GW-style diamond/hex texture via CSS */
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(0,0,0,0.018) 40px,
      rgba(0,0,0,0.018) 41px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 40px,
      rgba(0,0,0,0.018) 40px,
      rgba(0,0,0,0.018) 41px
    );
}

/* ----------------------------------------------------------
   AUTH CARD
   ---------------------------------------------------------- */

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--banner);
  box-shadow: var(--shadow);
  padding: var(--space-10) var(--space-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ----------------------------------------------------------
   WORDMARK
   ---------------------------------------------------------- */

.auth-wordmark {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: var(--text-4xl);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-hi);
  line-height: 1;
  text-align: center;

  /* GW-style: tight, imposing, slightly tracked */
}

.auth-tagline {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: var(--space-2);
  text-align: center;
}

/* ----------------------------------------------------------
   DIVIDER
   ---------------------------------------------------------- */

.auth-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0 var(--space-6);
  position: relative;
}

.auth-divider::before {
  content: '✦';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  padding: 0 var(--space-3);
  color: var(--border-hi);
  font-size: var(--text-xs);
  line-height: 1;
}

/* ----------------------------------------------------------
   FORM
   ---------------------------------------------------------- */

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ----------------------------------------------------------
   FIELD
   ---------------------------------------------------------- */

.auth-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.auth-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-hi);
}

.auth-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  min-height: var(--touch-target);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-input:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
  background: var(--surface);
}

.auth-input--error {
  border-color: var(--red);
  background: var(--red-light);
}

.auth-input--error:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.auth-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-field-error {
  font-size: var(--text-sm);
  color: var(--red);
  font-weight: 500;
}

/* ----------------------------------------------------------
   READ-ONLY EMAIL (Register screen)
   ---------------------------------------------------------- */

.auth-input--readonly {
  background: var(--surface-lo);
  color: var(--text-dim);
  cursor: default;
  border-style: dashed;
}

/* ----------------------------------------------------------
   SUBMIT BUTTON — GW banner style
   ---------------------------------------------------------- */

.auth-submit-btn {
  width: 100%;
  min-height: var(--touch-target);
  padding: var(--space-3) var(--space-6);
  background: var(--banner);
  color: var(--banner-text);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  margin-top: var(--space-2);
}

.auth-submit-btn:hover:not(:disabled) {
  background: var(--amber);
  color: var(--text-hi);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-btn-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

/* ----------------------------------------------------------
   SPINNER VARIANT — small, inline
   ---------------------------------------------------------- */

.spinner--sm {
  width: 14px;
  height: 14px;
  border-width: 2px;
  border-color: rgba(255,255,255,0.3);
  border-top-color: #ffffff;
}

/* ----------------------------------------------------------
   FOOTNOTE
   ---------------------------------------------------------- */

.auth-footnote {
  font-size: var(--text-xs);
  color: var(--text-dim);
  text-align: center;
  margin-top: var(--space-6);
  line-height: 1.5;
}

/* ----------------------------------------------------------
   LINK BUTTON — secondary action
   ---------------------------------------------------------- */

.auth-link-btn {
  font-size: var(--text-sm);
  color: var(--amber);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  margin-top: var(--space-4);
  font-family: var(--font-body);
}

.auth-link-btn:hover {
  color: var(--amber-dim);
}

/* ----------------------------------------------------------
   CONFIRMATION STATE
   ---------------------------------------------------------- */

.auth-confirmation {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  width: 100%;
}

.auth-confirmation-icon {
  font-size: var(--text-3xl);
  color: var(--amber);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.auth-confirmation-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text-hi);
  text-transform: uppercase;
  letter-spacing: var(--heading-tracking);
}

.auth-confirmation-body {
  font-size: var(--text-base);
  color: var(--text);
  line-height: 1.6;
}

.auth-confirmation-note {
  font-size: var(--text-sm);
  color: var(--text-dim);
  line-height: 1.5;
}

/* ----------------------------------------------------------
   ERROR BANNER — top-level form error
   ---------------------------------------------------------- */

.auth-error-banner {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--red-light);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
}

/* ----------------------------------------------------------
   FIELD HINT — helper text below input
   ---------------------------------------------------------- */

.auth-field-hint {
  font-size: var(--text-xs);
  color: var(--text-dim);
  line-height: 1.5;
}

/* ----------------------------------------------------------
   CONFIRMATION ICON VARIANT — error state
   ---------------------------------------------------------- */

.auth-confirmation-icon--error {
  color: var(--red);
}
