/* ============================================================
   Variables
   ============================================================ */
:root {
  --primary:   #1e3a5f;
  --accent:    #2563eb;
  --success:   #059669;
  --warning:   #d97706;
  --danger:    #dc2626;
  --bg:        #f1f5f9;
  --card:      #ffffff;
  --border:    #cbd5e1;
  --text:      #1e293b;
  --muted:     #64748b;
  --radius:    0.5rem;
  --shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: var(--primary);
  padding: 0.875rem 0;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-brand {
  color: #fff;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

/* Main */
.site-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

/* Footer */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 0.875rem 0;
  font-size: 0.8125rem;
}
.site-footer strong { color: #fff; }

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
}

/* ============================================================
   Typography helpers
   ============================================================ */
.page-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}
.page-subtitle {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}
.page-body {
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.status-icon {
  text-align: center;
  font-size: 2.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}
.help-text {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1rem;
}
.link-muted {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
  text-decoration: none;
}
.link-muted:hover { color: var(--accent); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
}

input[type="text"],
input[type="email"],
select {
  display: block;
  width: 100%;
  padding: 0.75rem 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.18);
}

.input-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Select custom arrow */
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 0.875rem;
}
.select-wrapper select { padding-right: 2.25rem; cursor: pointer; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: block;
  width: 100%;
  padding: 0.8125rem 1.25rem;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not([disabled]) { transform: scale(0.985); }
.btn + .btn,
a.btn + .btn,
.btn + a.btn { margin-top: 0.75rem; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not([disabled]) { background: #1d4ed8; text-decoration: none; color: #fff; }

.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover:not([disabled]) { background: #94a3b8; text-decoration: none; color: var(--text); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover:not([disabled]) { background: rgba(37,99,235,.06); text-decoration: none; }

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Alerts
   ============================================================ */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  border-left: 4px solid transparent;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-color: var(--success); }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: var(--danger); }
.alert-warning { background: #fef3c7; color: #92400e; border-color: var(--warning); }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: var(--accent); }

.mt { margin-top: 1rem; }

/* ============================================================
   Ticket summary
   ============================================================ */
.ticket-summary {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.ticket-row:last-child { border-bottom: none; }
.ticket-label { font-size: 0.875rem; color: var(--muted); }
.ticket-value { font-weight: 600; font-size: 0.9375rem; }
.total-value  { font-size: 1.125rem; color: var(--primary); }

/* Days remaining badge */
.dias-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border-radius: 999px;
  padding: 0.3125rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.dias-urgente { background: #fee2e2; color: #991b1b; }

/* ============================================================
   Validation
   ============================================================ */
.field-error {
  display: block;
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
input.input-validation-error,
select.input-validation-error {
  border-color: var(--danger) !important;
}

/* ============================================================
   Divider
   ============================================================ */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}
