/*
  Shared base styles — Firebird Finance
  Subset of the Task Tracker base.css: reset, layout shell, panels, login,
  forms, buttons, status/error. Requires tokens.css to be loaded first.
*/

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }

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

a:hover {
  text-decoration: underline;
}

table {
  border-collapse: collapse;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* ---------- Layout shell ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}

.topbar h1 {
  margin: 0;
  font-size: var(--text-xl);
}

.topbar-heading {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

main {
  padding: var(--space-6);
}

/* ---------- Cards / panels ---------- */
.panel {
  max-width: 1680px;
  margin: 0 auto;
}

#login-view.panel {
  max-width: 360px;
  margin: var(--space-12) auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8) var(--space-6);
}

#login-view h2 {
  margin: 0 0 var(--space-5);
  font-size: var(--text-xl);
}

/* ---------- Forms ---------- */
#login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 100%;
}

#login-form label {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
}

input,
select,
textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

textarea {
  resize: vertical;
  font-family: inherit;
}

.hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--weight-regular);
}

/* ---------- Buttons ---------- */
button {
  cursor: pointer;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

button:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:disabled:hover {
  background: var(--bg-surface);
  border-color: var(--border-default);
}

/* Primary action: submit buttons */
button[type='submit'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-on-accent);
}

button[type='submit']:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Quiet/ghost actions */
#logout-btn {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

#logout-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-default);
  color: var(--text-primary);
}

/* ---------- Status / errors ---------- */
.status {
  min-height: 20px;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.status.error,
.error {
  color: var(--danger-500);
}
