/* =============================================================================
   Auth Shell — reusable login + top bar + profile styles
   Extracted from USD Discovery District Rental Quotes app.
   Customize brand colors via :root variables below.
   ============================================================================= */

:root {
  --brand-red: #c02030;
  --brand-red-dark: #9a1a26;
  --brand-red-deep: #7a1520;
  --brand-red-soft: #fdf2f3;
  --brand-red-border: #f0c4c9;
  --brand-red-muted: #e8a0a8;
  --ink: #1a1a1a;
  --ink-muted: #555;
  --ink-faint: #777;
  --surface: #fff;
  --page-bg: #f5f3f3;
  --line: #ddd;
  --line-strong: #ccc;
  --focus: #c02030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--page-bg);
}

h1, h2, h3, legend {
  font-family: Arial, Helvetica, sans-serif;
}

.screen {
  min-height: 100vh;
}

/* ----- Login ----- */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-red);
  padding: 24px;
}

.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--brand-red);
  padding: 28px 28px 20px;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: 12px;
}

.login-header .brand-logo {
  display: block;
  max-width: 200px;
  max-height: 72px;
  width: auto;
  height: auto;
  margin: 0 auto 10px;
  object-fit: contain;
}

/* Text mark when no logo image is present */
.login-header .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.login-header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--brand-red);
}

.login-header p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.login-box label {
  display: block;
  margin: 12px 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--brand-red-deep);
}

.login-box input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #999;
  font: inherit;
}

.login-box .btn {
  width: 100%;
  margin-top: 16px;
}

.login-panel-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--brand-red);
  font-family: Arial, Helvetica, sans-serif;
}

.login-panel-help {
  margin: 0 0 14px;
  font-family: Arial, Helvetica, sans-serif;
}

.login-section-label {
  margin: 14px 0 8px;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  color: var(--brand-red);
}

.login-section-label:first-of-type {
  margin-top: 0;
}

.login-link-row {
  margin: 6px 0 0;
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
}

.login-link-row-center {
  margin-top: 14px;
  text-align: center;
}

.login-text-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.85rem;
  color: var(--brand-red);
  cursor: pointer;
  text-decoration: none;
}

.login-text-link:hover {
  text-decoration: underline;
}

.login-box .success {
  color: #166534;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  margin-top: 12px;
}

/* ----- Top bar ----- */
.topbar {
  background: var(--brand-red);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-brand .brand-logo {
  display: block;
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  /* Red logo on transparent → white on red bar */
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}

.topbar-brand .brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: bold;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.topbar-brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.2;
}

.topbar-sub {
  display: block;
  font-size: 0.8rem;
  opacity: 0.9;
  font-weight: normal;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

/* App footer — version + credit (subtle) */
.app-footer {
  text-align: center;
  padding: 12px 16px 14px;
  color: #888;
  font-size: 0.75rem;
  font-family: Arial, Helvetica, sans-serif;
  border-top: 3px solid var(--brand-red, #c02030);
  background: #fff;
  margin-top: auto;
}

.app-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
}

.app-footer-meta {
  opacity: 0.9;
}

.app-footer-sep {
  opacity: 0.45;
}

.app-footer-version {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f3f0f0;
  color: #666;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  line-height: 1.4;
  opacity: 0.9;
}

.app-footer-version[hidden] {
  display: none !important;
}

.app-footer-credit {
  margin-top: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  opacity: 0.65;
  color: #888;
}

.app-footer-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: inherit;
  color: var(--brand-red, #c02030);
  cursor: pointer;
  opacity: 0.85;
}

.app-footer-link:hover {
  opacity: 1;
  text-decoration: underline;
}

/* ----- Tabs (minimal shell) ----- */
.tabs {
  background: var(--brand-red-dark);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.tabs-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tab {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}

.tab:hover {
  color: #fff;
}

.tab.active {
  color: #fff;
  border-bottom-color: #fff;
  font-weight: bold;
}

/* ----- Layout ----- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 18px 20px 22px;
}

.panel h2 {
  margin: 0 0 16px;
  color: var(--brand-red);
  font-size: 1.2rem;
  border-bottom: 2px solid var(--brand-red);
  padding-bottom: 8px;
}

/* ----- Form ----- */
fieldset {
  border: 1px solid var(--line-strong);
  margin: 0 0 16px;
  padding: 12px 14px 14px;
}

legend {
  padding: 0 6px;
  color: var(--brand-red);
  font-size: 0.85rem;
  font-weight: bold;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  flex: 1 1 180px;
  margin-bottom: 8px;
}

.field label {
  display: block;
  margin-bottom: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--brand-red-deep);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #999;
  font: inherit;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand-red);
  outline-offset: -1px;
  border-color: var(--brand-red);
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #666;
  background: #f5f5f5;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn:hover {
  background: #e8e8e8;
}

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

.btn-primary {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.topbar .btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.topbar .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ----- Messages ----- */
.error {
  color: #9b1c1c;
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.success {
  color: #146c43;
  margin: 10px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: bold;
}

.warning {
  background: #fff3cd;
  border: 1px solid #e0c35a;
  color: #6b5200;
  padding: 8px 10px;
  margin: 8px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.muted {
  color: #666;
}

.small {
  font-size: 0.85rem;
}

/* ----- Profile card (PDF “Prepared by” preview) ----- */
.profile-card {
  border: 1px solid #e8c5c9;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.88rem;
  max-width: 520px;
  margin-top: 16px;
}

.profile-card-header {
  background: var(--brand-red);
  color: #fff;
  padding: 12px 14px;
}

.profile-card-header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.profile-body {
  padding: 12px 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

/* ----- Placeholder home panel ----- */
.home-card {
  border: 1px solid var(--line-strong);
  background: var(--brand-red-soft);
  padding: 20px;
  font-family: Arial, Helvetica, sans-serif;
  max-width: 560px;
}

.home-card h3 {
  margin: 0 0 8px;
  color: var(--brand-red);
}

.home-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }
}
