/* ============================================================
   EOG.GG — Global Styles
   Experience. Optimization. Greatness.
   ============================================================ */

@import './tokens.css';

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');


/* ============================================================
   RESET
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--mist);
  background-color: var(--surface-ground);
  min-height: 100vh;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
}

:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

::selection {
  background: var(--crimson-muted);
  color: var(--white);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--surface-base);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-500);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--steel-dark);
}


/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--white);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  line-height: var(--leading-relaxed);
  color: var(--mist);
}

small {
  font-size: var(--text-sm);
  color: var(--steel-light);
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--white);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-elevated);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
  color: var(--crimson-light);
}

/* Typography utilities */
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.font-mono     { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-base  { font-size: var(--text-base); }
.text-lg    { font-size: var(--text-lg); }
.text-xl    { font-size: var(--text-xl); }
.text-2xl   { font-size: var(--text-2xl); }
.text-3xl   { font-size: var(--text-3xl); }

.text-white   { color: var(--white); }
.text-mist    { color: var(--mist); }
.text-steel   { color: var(--steel-light); }
.text-muted   { color: var(--steel); }
.text-crimson { color: var(--crimson); }
.text-gold    { color: var(--gold); }
.text-success { color: var(--success-light); }
.text-warning { color: var(--warning-light); }
.text-error   { color: var(--error-light); }

.uppercase { text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.truncate  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Overline — section label style */
.overline {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--crimson);
}


/* ============================================================
   LAYOUT
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.container-sm {
  max-width: 768px;
}

.container-md {
  max-width: 1024px;
}

hr,
.divider {
  border: none;
  border-top: 1px solid var(--surface-border);
  margin-block: var(--space-6);
}

.divider-crimson {
  border-top-color: var(--crimson);
  opacity: 0.5;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--btn-height-md);
  padding-inline: var(--btn-px-md);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  white-space: nowrap;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition:
    background-color var(--transition-fast),
    border-color     var(--transition-fast),
    color            var(--transition-fast),
    box-shadow       var(--transition-fast),
    transform        var(--duration-instant) var(--ease-out);
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary — Crimson filled */
.btn-primary {
  background: var(--crimson);
  color: var(--white);
  border-color: var(--crimson);
}

.btn-primary:hover {
  background: var(--crimson-dark);
  border-color: var(--crimson-dark);
  box-shadow: var(--shadow-crimson);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--crimson-light);
  outline-offset: 2px;
}

/* Secondary — Crimson outlined */
.btn-secondary {
  background: transparent;
  color: var(--crimson);
  border-color: var(--crimson);
}

.btn-secondary:hover {
  background: var(--crimson-muted);
  box-shadow: var(--shadow-crimson);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

/* Tertiary — Ghost */
.btn-tertiary {
  background: transparent;
  color: var(--steel-light);
  border-color: transparent;
}

.btn-tertiary:hover {
  color: var(--white);
  background: var(--surface-elevated);
  border-color: var(--surface-border);
}

.btn-tertiary:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
}

/* Gold — Premium / whale-exclusive actions */
.btn-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-gold:hover {
  background: var(--gold-muted);
  box-shadow: var(--shadow-gold);
}

/* Steel — Subdued action */
.btn-steel {
  background: var(--surface-elevated);
  color: var(--steel-light);
  border-color: var(--surface-border-strong);
}

.btn-steel:hover {
  background: var(--surface-overlay);
  color: var(--mist);
  border-color: var(--steel-dark);
}

/* Sizes */
.btn-sm {
  height: var(--btn-height-sm);
  padding-inline: var(--btn-px-sm);
  font-size: var(--text-xs);
}

.btn-lg {
  height: var(--btn-height-lg);
  padding-inline: var(--btn-px-lg);
  font-size: var(--text-base);
}

/* Icon-only */
.btn-icon {
  padding-inline: 0;
  width: var(--btn-height-md);
  aspect-ratio: 1;
}

.btn-icon.btn-sm { width: var(--btn-height-sm); }
.btn-icon.btn-lg { width: var(--btn-height-lg); }

/* Full-width */
.btn-full { width: 100%; }


/* ============================================================
   TIER BADGES
   ============================================================ */

.badge-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--badge-size-md);
  height: var(--badge-size-md);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  flex-shrink: 0;
  line-height: 1;
}

.badge-tier-sm {
  width: var(--badge-size-sm);
  height: var(--badge-size-sm);
  font-size: 0.6rem;
}

.badge-tier-lg {
  width: var(--badge-size-lg);
  height: var(--badge-size-lg);
  font-size: var(--text-sm);
}

/* S — Crimson dominant */
.badge-s {
  background: var(--crimson);
  color: var(--white);
  border-color: var(--crimson);
  box-shadow: 0 0 10px var(--crimson-glow);
}

/* A — Gold outlined (premium) */
.badge-a {
  background: var(--gold-muted);
  color: var(--gold);
  border-color: var(--gold);
}

/* B — Steel outlined */
.badge-b {
  background: rgba(100, 116, 139, 0.08);
  color: var(--steel-light);
  border-color: var(--steel);
}

/* C — Muted, subdued */
.badge-c {
  background: rgba(100, 116, 139, 0.05);
  color: var(--steel-dark);
  border-color: var(--steel-dark);
}

/* Tier row — badge + label together */
.tier-group {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tier-group-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--steel-light);
}


/* ============================================================
   STATUS TAGS
   ============================================================ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 22px;
  padding-inline: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

/* Dot indicator shared */
.tag::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Whale Verified — Gold (crown/exclusive) */
.tag-whale {
  background: var(--gold-muted);
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.3);
}

.tag-whale::before {
  background: var(--gold);
  box-shadow: 0 0 5px var(--gold-glow);
}

/* Guild Verified — Crimson */
.tag-guild {
  background: var(--crimson-muted);
  color: var(--crimson-light);
  border-color: rgba(229, 57, 70, 0.3);
}

.tag-guild::before {
  background: var(--crimson);
  box-shadow: 0 0 5px var(--crimson-glow);
}

/* Meta — Steel */
.tag-meta {
  background: rgba(100, 116, 139, 0.1);
  color: var(--steel-light);
  border-color: rgba(100, 116, 139, 0.28);
}

.tag-meta::before {
  background: var(--steel-light);
}

/* New — Success green */
.tag-new {
  background: rgba(34, 197, 94, 0.07);
  color: var(--success-light);
  border-color: var(--success-border);
}

.tag-new::before {
  background: var(--success);
  box-shadow: 0 0 5px rgba(34, 197, 94, 0.5);
}


/* ============================================================
   ALERTS
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.alert-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.alert-body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  opacity: 0.85;
}

/* Success */
.alert-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  border-left-color: var(--success);
  color: var(--success-light);
}

/* Warning */
.alert-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  border-left-color: var(--warning);
  color: var(--warning-light);
}

/* Error */
.alert-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  border-left-color: var(--error);
  color: var(--error-light);
}

/* Info — Steel */
.alert-info {
  background: rgba(100, 116, 139, 0.07);
  border-color: rgba(100, 116, 139, 0.25);
  border-left-color: var(--steel);
  color: var(--steel-light);
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */

/* ── Label ─────────────────────────────────────────────────── */

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--steel-light);
  margin-bottom: var(--space-2);
  line-height: 1;
}

.form-label .required {
  color: var(--crimson);
  margin-left: var(--space-1);
}

/* ── Group ─────────────────────────────────────────────────── */

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

.form-hint {
  font-size: var(--text-xs);
  color: var(--steel);
  line-height: var(--leading-normal);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--crimson-light);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ── Input ─────────────────────────────────────────────────── */

.form-input {
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding-inline: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  color: var(--mist);
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color  var(--transition-fast),
    background    var(--transition-fast),
    box-shadow    var(--transition-fast);
}

.form-input::placeholder {
  color: var(--steel);
  opacity: 1;
}

.form-input:hover:not(:disabled):not(:focus) {
  border-color: var(--steel-dark);
}

.form-input:focus {
  border-color: var(--crimson);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 3px var(--crimson-muted);
}

.form-input:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.form-input.is-error {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px var(--error-bg);
}

.form-input.is-success {
  border-color: var(--success);
  box-shadow: 0 0 0 3px var(--success-bg);
}

.form-input-sm {
  height: var(--input-height-sm);
  padding-inline: var(--space-3);
  font-size: var(--text-xs);
}

.form-input-lg {
  height: var(--input-height-lg);
  padding-inline: var(--space-5);
  font-size: var(--text-base);
}

/* Mono input — for IDs, codes, numbers */
.form-input-mono {
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}

/* ── Textarea ──────────────────────────────────────────────── */

.form-textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
  background: var(--surface-raised);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  line-height: var(--leading-relaxed);
  transition:
    border-color var(--transition-fast),
    box-shadow   var(--transition-fast);
}

.form-textarea::placeholder {
  color: var(--steel);
  opacity: 1;
}

.form-textarea:hover:not(:disabled) {
  border-color: var(--steel-dark);
}

.form-textarea:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px var(--crimson-muted);
}

/* ── Select ────────────────────────────────────────────────── */

.form-select {
  display: block;
  width: 100%;
  height: var(--input-height-md);
  padding-inline: var(--space-4);
  padding-right: var(--space-10);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
  background-color: var(--surface-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color var(--transition-fast),
    box-shadow   var(--transition-fast);
}

.form-select:hover:not(:disabled) {
  border-color: var(--steel-dark);
}

.form-select:focus {
  border-color: var(--crimson);
  box-shadow: 0 0 0 3px var(--crimson-muted);
}

.form-select:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

/* ── Checkbox ──────────────────────────────────────────────── */

.form-checkbox-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.form-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--steel-dark);
  border-radius: var(--radius-xs);
  cursor: pointer;
  position: relative;
  transition:
    background-color var(--transition-fast),
    border-color     var(--transition-fast),
    box-shadow       var(--transition-fast);
}

.form-checkbox:hover {
  border-color: var(--steel-light);
}

.form-checkbox:checked {
  background: var(--crimson);
  border-color: var(--crimson);
}

.form-checkbox:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='9' viewBox='0 0 11 9'%3E%3Cpath d='M1 4.5L4 7.5L10 1' stroke='white' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.form-checkbox:indeterminate {
  background: var(--crimson-muted);
  border-color: var(--crimson);
}

.form-checkbox:indeterminate::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='2' viewBox='0 0 10 2'%3E%3Cpath d='M1 1h8' stroke='%23E53946' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.form-checkbox:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

.form-checkbox:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.form-checkbox-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
  line-height: 1.35;
  padding-top: 1px;
}

/* ── Toggle / Switch ───────────────────────────────────────── */

.form-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.form-toggle {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 24px;
  min-width: 44px;
  background: var(--ink-500);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition: background-color var(--transition-fast);
}

.form-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--steel);
  transition:
    transform    var(--duration-fast) var(--ease-spring),
    background   var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.form-toggle:checked {
  background: var(--crimson);
}

.form-toggle:checked::before {
  transform: translateX(20px);
  background: var(--white);
}

.form-toggle:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

.form-toggle:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.form-toggle-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
}

/* ── Radio ─────────────────────────────────────────────────── */

.form-radio-wrap {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
}

.form-radio {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background: var(--surface-raised);
  border: 1px solid var(--steel-dark);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  transition:
    border-color var(--transition-fast),
    box-shadow   var(--transition-fast);
  margin-top: 1px;
}

.form-radio:hover {
  border-color: var(--steel-light);
}

.form-radio:checked {
  border-color: var(--crimson);
  background: var(--crimson-muted);
}

.form-radio:checked::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--crimson);
  border-radius: var(--radius-full);
  box-shadow: 0 0 5px var(--crimson-glow);
}

.form-radio:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 2px;
}

.form-radio:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.form-radio-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--mist);
  line-height: 1.35;
  padding-top: 1px;
}

/* ── Input group (icon + input) ────────────────────────────── */

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

.input-group .input-icon {
  position: absolute;
  left: var(--space-3);
  color: var(--steel);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.input-group .input-icon-right {
  left: unset;
  right: var(--space-3);
}

.input-group .form-input:has(+ .input-icon),
.input-group .form-input.has-icon-left {
  padding-left: var(--space-10);
}

.input-group .form-input.has-icon-right {
  padding-right: var(--space-10);
}
