/* ============================================================
   CL1CK Recruit — Base Stylesheet
   Mobile-first, max content width 480px
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --red:        #e03535;
  --gold:       #f5c518;
  --bg:         #0d0d0d;
  --card:       #242428;
  --card-alt:   #2e2e34;
  --text:       #ffffff;
  --text-muted: #c8c8c8;
  --success:    #22c55e;
  --error:      #ef4444;

  --font: system-ui, -apple-system, sans-serif;
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  20px;

  --transition: 0.18s ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

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

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Layout — centered column, max 480px ── */
.page {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding: 24px 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.25; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
h4 { font-size: 1rem;     font-weight: 600; }

.text-muted   { color: var(--text-muted); }
.text-red     { color: var(--red); }
.text-gold    { color: var(--gold); }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.text-center  { text-align: center; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
}

.card-alt {
  background: var(--card-alt);
  border-radius: var(--radius);
  padding: 20px;
}

.card-bordered {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* Primary — red */
.btn-primary {
  background: var(--red);
  color: #fff;
}

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

/* Gold */
.btn-gold {
  background: var(--gold);
  color: #0d0d0d;
}

.btn-gold:hover:not(:disabled) {
  opacity: 0.88;
}

/* Ghost / outline */
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.45);
}

/* Danger */
.btn-danger {
  background: var(--error);
  color: #fff;
}

/* Inline / auto-width */
.btn-inline {
  width: auto;
  padding: 10px 18px;
  font-size: 0.875rem;
}

/* Small */
.btn-sm {
  padding: 9px 14px;
  font-size: 0.8125rem;
  border-radius: 6px;
}

/* ── Inputs ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--card-alt);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.input:focus {
  border-color: var(--red);
}

.input.input-error {
  border-color: var(--error);
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.input-hint.error {
  color: var(--error);
}

/* Select */
select.input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23c8c8c8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  appearance: none;
}

/* Textarea */
textarea.input {
  resize: vertical;
  min-height: 100px;
}

/* ── Form layout ── */
.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.badge-red    { background: rgba(224, 53, 53, 0.18); color: var(--red); }
.badge-gold   { background: rgba(245, 197, 24, 0.15); color: var(--gold); }
.badge-green  { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-muted  { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--card-alt);
  flex-shrink: 0;
}

.avatar-sm  { width: 36px;  height: 36px; }
.avatar-md  { width: 56px;  height: 56px; }
.avatar-lg  { width: 88px;  height: 88px; }
.avatar-xl  { width: 120px; height: 120px; }

/* ── Alert / Toast ── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid currentColor;
}

.alert-error   { background: rgba(239, 68, 68, 0.12);  color: var(--error); }
.alert-success { background: rgba(34, 197, 94, 0.12);  color: var(--success); }
.alert-info    { background: rgba(245, 197, 24, 0.10); color: var(--gold); }

/* ── Spinner ── */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Utility ── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-4   { gap: 4px; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.gap-16  { gap: 16px; }
.gap-20  { gap: 20px; }
.gap-24  { gap: 24px; }
.w-full  { width: 100%; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-12   { margin-top: 12px; }
.mt-16   { margin-top: 16px; }
.mt-24   { margin-top: 24px; }
.mt-32   { margin-top: 32px; }
.mb-4    { margin-bottom: 4px; }
.mb-8    { margin-bottom: 8px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.p-0     { padding: 0; }
.hidden  { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Logo / brand ── */
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}

.logo span {
  color: var(--red);
}

/* ── Bottom nav (shared) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  z-index: 100;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 12px;
  transition: color var(--transition);
}

.bottom-nav a.active,
.bottom-nav a:hover {
  color: var(--red);
  text-decoration: none;
}

/* ── Safe area padding for pages with bottom nav ── */
.has-bottom-nav {
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
