/* ==========================================================================
   Auth Styles — Goles Pro
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg:          #0A0A0A;
  --surface:     #111118;
  --surface-2:   #1A1A2E;
  --border:      #222233;
  --border-2:    #333344;
  --text:        #FFFFFF;
  --text-muted:  #A1A1A1;
  --text-dim:    #666680;
  --text-dimmer: #444455;
  --accent:      #582CFF;
  --accent-h:    #6B3FFF;
  --input-bg:    #0A0A0A;
  --flash-notice-bg: rgba(34, 197, 94, 0.12);
  --flash-notice-border: rgba(34, 197, 94, 0.3);
  --flash-notice-text: #86EFAC;
  --flash-alert-bg: rgba(239, 68, 68, 0.12);
  --flash-alert-border: rgba(239, 68, 68, 0.3);
  --flash-alert-text: #FCA5A5;
  --success-icon-bg: rgba(34, 197, 94, 0.15);
  --success-icon-border: rgba(34, 197, 94, 0.3);
  --info-bg: rgba(88, 44, 255, 0.1);
  --info-border: rgba(88, 44, 255, 0.25);
  --info-text: #C4B5FD;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.25);
  --error-text: #FCA5A5;
}

[data-theme="light"] {
  --bg:          #F4F4F8;
  --surface:     #FFFFFF;
  --surface-2:   #EEF0F8;
  --border:      #E0E0EC;
  --border-2:    #C8C8D8;
  --text:        #0A0A1A;
  --text-muted:  #5A5A78;
  --text-dim:    #8888A8;
  --text-dimmer: #AAAACC;
  --accent:      #582CFF;
  --accent-h:    #6B3FFF;
  --input-bg:    #F4F4F8;
  --flash-notice-bg: rgba(22, 163, 74, 0.10);
  --flash-notice-border: rgba(22, 163, 74, 0.3);
  --flash-notice-text: #15803D;
  --flash-alert-bg: rgba(220, 38, 38, 0.08);
  --flash-alert-border: rgba(220, 38, 38, 0.25);
  --flash-alert-text: #B91C1C;
  --success-icon-bg: rgba(22, 163, 74, 0.12);
  --success-icon-border: rgba(22, 163, 74, 0.3);
  --info-bg: rgba(88, 44, 255, 0.07);
  --info-border: rgba(88, 44, 255, 0.2);
  --info-text: #5A3FCC;
  --error-bg: rgba(220, 38, 38, 0.07);
  --error-border: rgba(220, 38, 38, 0.2);
  --error-text: #B91C1C;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.auth-body a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Background glows ---------- */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.18;
}

.auth-bg-glow--1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  left: -200px;
}

.auth-bg-glow--2 {
  width: 400px;
  height: 400px;
  background: #BF40FF;
  bottom: -150px;
  right: -150px;
}

/* ---------- Header ---------- */
.auth-header {
  position: relative;
  z-index: 10;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.auth-theme-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

.auth-theme-btn svg {
  width: 18px;
  height: 18px;
}

/* Show moon in dark mode, sun in light mode */
[data-theme="dark"] .auth-theme-btn .icon-sun,
[data-theme="light"] .auth-theme-btn .icon-moon {
  display: none;
}

.auth-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* ---------- Main ---------- */
.auth-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 60px;
}

/* ---------- Flash messages ---------- */
.auth-flash {
  width: 100%;
  max-width: 440px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.auth-flash--notice {
  background: var(--flash-notice-bg);
  border-color: var(--flash-notice-border);
  color: var(--flash-notice-text);
}

.auth-flash--alert {
  background: var(--flash-alert-bg);
  border-color: var(--flash-alert-border);
  color: var(--flash-alert-text);
}

/* ---------- Card ---------- */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-card-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.auth-card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ---------- Tabs (login method switcher) ---------- */
.auth-tabs {
  display: flex;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.is-active {
  background: var(--accent);
  color: #FFFFFF;
}

/* ---------- Panel visibility ---------- */
.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
}

/* ---------- Form elements ---------- */
.auth-form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.auth-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input::placeholder {
  color: var(--text-dimmer);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 44, 255, 0.18);
}

.auth-input.is-invalid {
  border-color: #EF4444;
}

/* ---------- Errors ---------- */
.auth-field-error {
  font-size: 12px;
  color: var(--flash-alert-text);
  margin-top: 6px;
}

.auth-errors {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.auth-errors-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--flash-alert-text);
  margin-bottom: 6px;
}

.auth-errors ul {
  list-style: none;
  padding: 0;
}

.auth-errors li {
  font-size: 13px;
  color: var(--flash-alert-text);
  padding: 2px 0;
}

.auth-errors li::before {
  content: "· ";
}

/* ---------- Forgot link ---------- */
.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-forgot {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s;
}

.auth-forgot:hover {
  color: #7B52FF;
}

/* ---------- Submit button ---------- */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 8px;
}

.auth-btn:hover {
  background: var(--accent-h);
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.auth-btn--ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

/* ---------- Divider ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: #222233;
}

.auth-divider-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dimmer);
  white-space: nowrap;
}

/* ---------- Social buttons ---------- */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-social-btn:hover {
  background: var(--surface-2);
  border-color: var(--border-2);
}

.auth-social-btn svg,
.auth-social-btn img {
  flex-shrink: 0;
}

/* ---------- Footer link ---------- */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.auth-back-link:hover {
  color: var(--text);
}

.auth-footer-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer-link a {
  color: var(--accent);
  font-weight: 600;
  transition: color 0.15s;
}

.auth-footer-link a:hover {
  color: #7B52FF;
}

/* ---------- Success state ---------- */
.auth-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-icon-bg);
  border: 1px solid var(--success-icon-border);
  margin: 0 auto 24px;
}

.auth-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
}

.auth-success-body {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-success-body strong {
  color: var(--text);
}

/* ---------- Info box ---------- */
.auth-info {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--info-text);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .auth-header {
    padding: 20px 20px;
  }

  .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
  }

  .auth-card-title {
    font-size: 22px;
  }

  .auth-main {
    justify-content: flex-start;
    padding-top: 12px;
  }
}

/* ---------- Pool join not found ---------- */
.pool-notfound-card {
  max-width: 400px;
  text-align: center;
}

.pool-notfound-emoji {
  font-size: 32px;
  margin-bottom: 12px;
}

.pool-notfound-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pool-notfound-body {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.pool-notfound-btn {
  display: inline-flex;
}

/* ---------- Pool join page (signed-in auth layout) ---------- */
.pool-join-shell-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}

.pool-join-card-auth {
  max-width: 520px;
  width: 100%;
}

.pool-join-header {
  text-align: center;
  margin-bottom: 28px;
}

.pool-join-icon {
  width: 56px;
  height: 56px;
  background: #1A1A2E;
  border: 2px solid #582CFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.pool-join-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.pool-join-pool-name {
  font-size: 15px;
  font-weight: 700;
  color: #BF80FF;
  margin-bottom: 4px;
}

.pool-join-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.pool-join-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-join {
  width: 100%;
  height: 52px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-decline {
  width: 100%;
  height: 52px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .auth-bg-glow {
    display: none;
  }
}
