/* ============================================================
   EnergyPoint Tickets — FP-Solution Brand
   Source: ~/Desktop/Projects/fresh-puls/src/index.css
   ============================================================ */

:root {
  --brand-50:  #e8f0ff;
  --brand-100: #d5e3ff;
  --brand-200: #b3cbff;
  --brand-300: #7fa8ff;
  --brand-400: #4a7dff;
  --brand-500: #265CF2;
  --brand-600: #1246D6;
  --brand-700: #0f39b0;
  --brand-800: #17295A;
  --brand-900: #0E1920;

  --surface:           #f7f8fb;
  --surface-elevated:  #ffffff;
  --foreground:        #1a1f36;
  --foreground-muted:  #6b7280;
  --foreground-subtle: #9ca3af;
  --border:        rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.10);

  --status-open-bg:     #fef3c7;
  --status-open-fg:     #92400e;
  --status-open-border: #fcd34d;

  --status-resolved-bg:     #dcfce7;
  --status-resolved-fg:     #15803d;
  --status-resolved-border: #86efac;

  --status-reminded-bg:     #fed7aa;
  --status-reminded-fg:     #9a3412;
  --status-reminded-border: #fdba74;

  --error:   #b91c1c;
  --error-bg: #fef2f2;

  --font-sans:  'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }
body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, var(--surface) 0%, #eef1f6 100%);
  color: var(--foreground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* ----- background pattern + glow orbs ---------------------- */
.bg-grid {
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.bg-orb-1 {
  width: 600px; height: 600px;
  background: rgba(38, 92, 242, 0.07);
  top: -5%; left: -10%;
}
.bg-orb-2 {
  width: 400px; height: 400px;
  background: rgba(127, 168, 255, 0.06);
  bottom: -5%; right: -5%;
}

/* ----- header ---------------------------------------------- */
.site-header {
  position: relative;
  z-index: 1;
  padding: 20px 16px 0;
}
.header-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  color: white;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 2px 8px rgba(38, 92, 242, 0.25),
    0 0 16px rgba(38, 92, 242, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.header-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
  line-height: 1.2;
}
.header-sub {
  font-size: 12px;
  color: var(--foreground-muted);
  line-height: 1.2;
  margin-top: 2px;
}

/* ----- main page ------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 32px 16px 48px;
}
.container {
  max-width: 720px;
  margin: 0 auto;
}

/* ----- glass card ------------------------------------------ */
.card {
  border-radius: 24px;
  padding: 32px;
}
.glass-card {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.75) 100%
  );
  backdrop-filter: blur(32px) saturate(140%);
  -webkit-backdrop-filter: blur(32px) saturate(140%);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 12px 40px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  animation: fade-up 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), transparent);
  pointer-events: none;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- loading state --------------------------------------- */
.state-loading,
.state-success,
.state-error {
  text-align: center;
  padding: 56px 32px;
}
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(38, 92, 242, 0.12);
  border-top-color: var(--brand-500);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dots::after {
  content: '';
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

.state-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 8px;
}
.state-sub {
  font-size: 15px;
  color: var(--foreground-muted);
  line-height: 1.5;
}

/* ----- ticket header (ref + status) ------------------------ */
.ticket-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.ticket-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-500);
  margin-bottom: 4px;
}
.ticket-ref {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--foreground);
  font-feature-settings: 'tnum';
  line-height: 1;
}
.ticket-status-block {
  text-align: right;
}
.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--status-open-border);
  background: var(--status-open-bg);
  color: var(--status-open-fg);
}
.status-pill[data-status="resolved"] {
  background: var(--status-resolved-bg);
  color: var(--status-resolved-fg);
  border-color: var(--status-resolved-border);
}
.status-pill[data-status="reminded"] {
  background: var(--status-reminded-bg);
  color: var(--status-reminded-fg);
  border-color: var(--status-reminded-border);
}
.ticket-created {
  font-size: 12px;
  color: var(--foreground-muted);
  margin-top: 8px;
}

/* ----- ticket grid (caller + anliegen) --------------------- */
.ticket-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--foreground-subtle);
  margin-bottom: 10px;
}
.kv {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kv-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  align-items: baseline;
}
.kv dt {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground-muted);
  margin: 0;
}
.kv dd {
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
  margin: 0;
  word-break: break-word;
}

/* ----- subject + details ----------------------------------- */
.ticket-subject-block,
.ticket-details-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.ticket-subject {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
  color: var(--foreground);
}
.ticket-details {
  font-size: 15px;
  line-height: 1.6;
  color: var(--foreground);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ----- action area ----------------------------------------- */
.action-area {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.btn-primary {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(38, 92, 242, 0.25),
    0 0 24px rgba(38, 92, 242, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  pointer-events: none;
  border-radius: inherit;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 4px 16px rgba(38, 92, 242, 0.35),
    0 0 32px rgba(38, 92, 242, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-primary:focus-visible {
  outline: 3px solid rgba(38, 92, 242, 0.35);
  outline-offset: 3px;
}
.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}
.btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  margin-left: 10px;
  vertical-align: middle;
  animation: spin 0.7s linear infinite;
}
.btn-primary[data-loading="true"] .btn-spinner { display: inline-block; }
.btn-primary[data-loading="true"] .btn-label::after { content: '\00a0…'; }

.action-hint {
  font-size: 13px;
  color: var(--foreground-muted);
  margin: 14px auto 0;
  max-width: 420px;
  line-height: 1.5;
}

/* ----- resolved-banner ------------------------------------- */
.resolved-banner {
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--status-resolved-bg);
  border: 1px solid var(--status-resolved-border);
  color: var(--status-resolved-fg);
  display: flex;
  align-items: center;
  gap: 14px;
}
.resolved-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(21, 128, 61, 0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--status-resolved-fg);
}
.resolved-title {
  font-size: 15px;
  font-weight: 700;
}
.resolved-sub {
  font-size: 13px;
  margin-top: 2px;
  opacity: 0.85;
}

/* ----- success state --------------------------------------- */
.success-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 24px;
  background: var(--status-resolved-bg);
  color: var(--status-resolved-fg);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--status-resolved-border);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ----- error state ----------------------------------------- */
.error-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: var(--error-bg);
  color: var(--error);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fecaca;
}

/* ----- footer ---------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 24px 16px 32px;
}
.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: 12px;
  color: var(--foreground-subtle);
}
.footer-inner .dot { margin: 0 6px; opacity: 0.5; }

/* ----- responsive ------------------------------------------ */
@media (max-width: 640px) {
  .card { padding: 24px 20px; border-radius: 20px; }
  .state-loading, .state-success, .state-error { padding: 40px 20px; }
  .ticket-grid { grid-template-columns: 1fr; gap: 24px; }
  .ticket-ref { font-size: 26px; }
  .ticket-header { flex-direction: column; gap: 12px; }
  .ticket-status-block { text-align: left; }
  .kv-row { grid-template-columns: 92px 1fr; }
  .header-sub { display: none; }
  .footer-inner span:nth-child(4),
  .footer-inner span:nth-child(5),
  .footer-inner span:nth-child(6) { display: none; }
}

/* ----- reduced motion -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
