/* ─── CSS Variables ─── */
:root {
  --text-primary: #111111;
  --text-body: #595959;
  --text-muted: #6B7280;
  --bg-white: #FFFFFF;
  --bg-dark: #000000;
  --bg-card: #F9FAFB;
  --bg-light: #F3F4F6;
  --border: #E5E7EB;
  --star: #FACC15;
  --error: #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;
  --radius-pill: 9999px;
  --radius-card: 12px;
  --radius-input: 8px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: 0.15s ease;
}

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-body);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
input, textarea, select { font-family: var(--font-body); }
img { max-width: 100%; display: block; }

/* ─── Typography ─── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
}

/* ─── Section Label ─── */
.section-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3.36px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Field Label ─── */
.field-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.field-group {
  margin-bottom: 16px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ─── Inputs ─── */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

textarea {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-dark);
  color: var(--bg-white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: #333333;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.btn-outline:hover {
  background: var(--bg-card);
}

.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─── Badge ─── */
.badge {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── Panel Card ─── */
.panel-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.panel-header {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

/* ─── Info Note ─── */
.info-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 16px;
  line-height: 1.5;
}

/* ─── Action Row ─── */
.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ─── Char Counter ─── */
.char-counter {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
}

.char-counter.over-limit {
  color: var(--error);
  font-weight: 600;
}

/* ─── Spinner ─── */
.spinner {
  animation: spin 0.8s linear infinite;
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  vertical-align: middle;
}

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

/* ─── Fade In ─── */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Shake (login error) ─── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.5s ease;
}
