/* Flight Ticket System - Real airline / boarding pass style */

:root {
  --airline-dark: #0d2137;
  --airline-blue: #143258;
  --airline-mid: #1e4976;
  --airline-accent: #2a6bb5;
  --airline-light: #e8f0f8;
  --gold: #c9a227;
  --white: #fff;
  --gray-100: #f5f6f8;
  --gray-200: #e2e6ea;
  --gray-600: #5c6573;
  --gray-800: #2d3439;
  --font-display: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.45;
}

/* ----- Login ----- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--airline-dark) 0%, var(--airline-mid) 50%, var(--airline-accent) 100%);
}

.login-wrapper {
  width: 100%;
  max-width: 380px;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  overflow: hidden;
}

.login-header {
  background: var(--airline-blue);
  color: var(--white);
  padding: 28px 24px;
  text-align: center;
}

.login-logo {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.login-header h1 {
  margin: 0 0 4px 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.login-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
}

.login-form {
  padding: 28px 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 1rem;
}

.form-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--gray-600);
}

input[readonly] {
  background: var(--gray-100);
  color: var(--gray-800);
  cursor: default;
}

.auto-fill-row .form-group label {
  color: var(--gray-600);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--airline-accent);
  box-shadow: 0 0 0 3px rgba(42, 107, 181, 0.15);
}

.alert {
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.btn-primary {
  background: var(--airline-blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--airline-mid);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
}

.btn-secondary {
  background: var(--gray-600);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--gray-800);
}

.btn-outline-sm {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  padding: 6px 12px;
  font-size: 0.9rem;
  margin-top: 6px;
}

.btn-outline-sm:hover {
  background: var(--gray-100);
}

.form-group-btn label {
  visibility: hidden;
}

.total-input {
  font-weight: 700;
  font-size: 1.1rem;
}

.passenger-row {
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.passenger-row select {
  width: 90px;
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
}

.passenger-row input {
  flex: 1;
  min-width: 0;
}
.passenger-row input.passenger-dob {
  flex: 0 1 160px;
  font-size: 0.9rem;
}

/* ----- Dashboard ----- */
.dashboard-page {
  min-height: 100vh;
}

.dashboard-header {
  background: var(--airline-blue);
  color: var(--white);
  padding: 14px 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  margin-left: 24px;
}
.header-nav a {
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
}
.header-nav a:hover {
  color: #fff;
  text-decoration: underline;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ticket-actions {
  white-space: nowrap;
}
.ticket-actions .btn-link {
  font-size: 0.85rem;
  color: var(--airline-accent);
  text-decoration: none;
  margin-right: 8px;
}
.ticket-actions .btn-link:hover {
  text-decoration: underline;
}

.user-name {
  font-size: 0.9rem;
  opacity: 0.95;
}

.dashboard-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1000px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  overflow: hidden;
}

.panel h2 {
  margin: 0;
  padding: 18px 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--airline-blue);
  border-bottom: 1px solid var(--gray-200);
}

/* Form */
.ticket-form {
  padding: 20px;
}

.form-row {
  margin-bottom: 14px;
}

.form-row.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-row.three-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .form-row.two-cols,
  .form-row.three-cols {
    grid-template-columns: 1fr;
  }
}

.form-actions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.section-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.download-link-wrap {
  padding: 12px;
  background: var(--airline-light);
  border-radius: 8px;
  font-size: 0.9rem;
}

.download-link-wrap a {
  color: var(--airline-accent);
  font-weight: 600;
}

/* Live preview - Boarding pass style */
.live-preview {
  padding: 20px;
  background: var(--gray-100);
}

.boarding-pass {
  max-width: 420px;
  margin: 0 auto 20px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.bp-banner {
  color: var(--white);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
}

.bp-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.bp-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.bp-logo-img {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.bp-logo-fallback {
  font-size: 1.6rem;
  opacity: 0.95;
}

.bp-logo-fallback.hidden {
  display: none;
}

.bp-airline {
  font-size: 1rem;
  flex: 1;
}

.bp-slogan {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.9;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.5);
}

.bp-flight {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.bp-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 0;
}

.bp-col {
  padding: 10px 12px;
  border-right: 1px dashed var(--gray-200);
  border-bottom: 1px dashed var(--gray-200);
  min-height: 52px;
}

.bp-col:nth-child(3n) { border-right: none; }

.bp-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  margin-bottom: 2px;
}

.bp-value,
.bp-code {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
}

.bp-city {
  font-size: 0.75rem;
  color: var(--gray-600);
}

.bp-qr-wrap {
  grid-column: span 3;
  padding: 12px;
  text-align: center;
  border-right: none;
  border-bottom: none;
}

.qrcode-preview {
  display: inline-block;
  margin-top: 6px;
  padding: 6px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
}

.qrcode-preview canvas,
.qrcode-preview img {
  display: block;
  max-width: 100px;
  height: auto;
}

.bp-footer {
  background: var(--airline-light);
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--airline-mid);
  letter-spacing: 0.03em;
}

/* Agency & Invoice preview */
.agency-preview {
  max-width: 420px;
  margin: 12px auto 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.invoice-preview {
  max-width: 420px;
  margin: 12px auto 0;
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gray-100);
  font-size: 0.9rem;
  font-weight: 700;
}

.inv-table {
  padding: 12px 16px;
}

.inv-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--gray-200);
}

.inv-row:last-child { border-bottom: none; }

.inv-row.total {
  font-weight: 700;
  font-size: 1rem;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--airline-blue);
}

/* Recent tickets table */
.recent-panel .recent-table-wrap {
  overflow-x: auto;
}

.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.recent-table th,
.recent-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.recent-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-800);
}

.recent-table code {
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
}

.recent-table .empty {
  color: var(--gray-600);
  font-style: italic;
  text-align: center;
  padding: 24px;
}

.recent-table tbody tr:hover {
  background: var(--airline-light);
}
