/* =========================================================
   Gayuma Support — Global Styles
   ========================================================= */

:root {
  /* Brand */
  --primary: #0dbb83;
  --primary-dark: #0a9c6d;
  --primary-soft: #e7f8f1;
  --accent: #0dbb83;
  --accent-dark: #0a9c6d;

  /* Surfaces */
  --bg: #f6f8fa;
  --paper: #ffffff;
  --card-bg: #ffffff;
  --ink: #0b1220;
  --ink-2: #131c31;
  --ink-soft: #64748b;

  /* Text */
  --text: #0f172a;
  --text-muted: #64748b;

  /* Lines */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Status */
  --blue: #4c8dff;
  --amber: #f5a524;
  --danger: #e5484d;

  /* Shape & depth */
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -8px rgba(15, 23, 42, .08);
  --ring: 0 0 0 4px rgba(13, 187, 131, .16);

  --font: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container-sm { max-width: 480px; margin: 60px auto; padding: 24px; }

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar .brand { font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.navbar .nav-links a {
  color: var(--text-muted); text-decoration: none; margin-left: 22px; font-size: 14px; font-weight: 500;
  transition: color .15s;
}
.navbar .nav-links a:hover { color: var(--primary-dark); }

/* ---------- Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

h1, h2, h3 { margin-top: 0; letter-spacing: -.02em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(10, 156, 109, .3), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn[disabled] { opacity: .7; cursor: progress; }
.btn-secondary { background: #64748b; box-shadow: none; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: var(--danger); box-shadow: none; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label { display: block; margin-bottom: 7px; font-weight: 600; font-size: 13.5px; color: var(--text); }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 100px; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--text-muted); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
tr:hover td { background: #fafbfc; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Stats ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-box {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-box .num { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat-box .label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; }

/* ---------- Chat ---------- */
.chat-bubble {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  max-width: 80%;
}
.chat-bubble.client { background: #eef2ff; margin-right: auto; border-bottom-left-radius: 4px; }
.chat-bubble.admin { background: var(--primary-soft); margin-left: auto; border-bottom-right-radius: 4px; }
.chat-bubble .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid transparent;
}
.alert-error { background: #fff1f1; color: #b4232a; border-color: #fbd0d2; }
.alert-success { background: var(--primary-soft); color: var(--primary-dark); border-color: #b8ebd7; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }


/* =========================================================
   AUTH SCREENS (client login / register)
   ========================================================= */

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--paper);
}

/* ---- Left: brand panel ---- */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  display: flex;
  align-items: center;
  padding: 64px;
  isolation: isolate;
}
.auth-brand::before {            /* soft green glow */
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  top: -220px; left: -180px;
  background: radial-gradient(circle, rgba(13, 187, 131, .32) 0%, rgba(13, 187, 131, 0) 65%);
  z-index: -1;
}
.auth-brand::after {             /* faint grid */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
  z-index: -1;
}
.auth-brand-inner { width: 100%; max-width: 440px; margin: 0 auto; }

.auth-logo {
  font-weight: 800;
  font-size: 28px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 64px;
  letter-spacing: -.025em;
}
.auth-logo-mark {
  width: 48px; height: 48px;
  background: rgba(13, 187, 131, .14);
  border: 1px solid rgba(13, 187, 131, .35);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.auth-logo-mark svg { width: 26px; height: 26px; }

.auth-tagline {
  color: #fff;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -.03em;
}
.auth-sub {
  color: rgba(255, 255, 255, .64);
  font-size: 15.5px;
  line-height: 1.7;
  margin: 0 0 40px;
}

/* Ticket preview card */
.ticket-preview {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .6);
  margin-bottom: 32px;
}
.ticket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.ticket-id { font-size: 12.5px; color: rgba(255, 255, 255, .5); font-weight: 600; }
.ticket-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #7ff0c6;
  background: rgba(13, 187, 131, .14);
  border: 1px solid rgba(13, 187, 131, .3);
  padding: 3px 10px;
  border-radius: 20px;
}
.ticket-title { color: #fff; font-size: 15px; font-weight: 600; margin: 0 0 18px; }

.auth-rail-preview { display: flex; align-items: center; gap: 10px; }
.preview-stop {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .78);
  font-weight: 600;
  white-space: nowrap;
}
.preview-line { flex: 1; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .14); min-width: 12px; }
.preview-line.done { background: linear-gradient(90deg, var(--blue), var(--amber)); }
.preview-line.done-2 { background: linear-gradient(90deg, var(--amber), var(--accent)); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-open { background: var(--blue); box-shadow: 0 0 0 3px rgba(76, 141, 255, .22); }
.dot-pending { background: var(--amber); box-shadow: 0 0 0 3px rgba(245, 165, 36, .22); }
.dot-resolved { background: var(--accent); box-shadow: 0 0 0 3px rgba(13, 187, 131, .25); }

.auth-trust {
  font-size: 13.5px;
  color: rgba(255, 255, 255, .5);
  line-height: 1.6;
  margin: 0;
}

/* ---- Right: form side ---- */
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  padding: 40px 32px;
}
.auth-form-box { width: 100%; max-width: 380px; }
.auth-form-card { padding: 0; }   /* plain, no box — modern look */

.auth-mobile-logo { display: none; }

.auth-title { font-size: 28px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.03em; color: var(--ink); }
.auth-lead { margin: 0 0 30px; color: var(--text-muted); font-size: 15px; }

.input-wrap { position: relative; }
.input-wrap input:not([type=checkbox]):not([type=radio]) { padding-right: 46px; }
.toggle-pass {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.toggle-pass:hover { color: var(--ink); background: #f1f5f9; }
.toggle-pass:focus-visible { outline: none; box-shadow: var(--ring); }

.auth-form-card .btn-block { padding: 13px 20px; font-size: 15px; margin-top: 6px; }

.auth-foot { margin: 28px 0 0; font-size: 13px; color: var(--text-muted); text-align: center; }
.staff-link { color: var(--ink-soft); font-size: 13px; text-decoration: none; font-weight: 500; }
.staff-link:hover { color: var(--accent-dark); }

/* Spinner for loading state */
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* One orchestrated entrance on the ticket card only */
@keyframes lift-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.ticket-preview { animation: lift-in .7s cubic-bezier(.2, .7, .2, 1) both .15s; }

@media (prefers-reduced-motion: reduce) {
  .ticket-preview { animation: none; }
  .btn .spinner { animation-duration: 1.6s; }
}

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .auth-brand { padding: 48px 40px; }
  .auth-tagline { font-size: 32px; }
}

@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-brand { display: none; }
  .auth-form-side { padding: 32px 24px; align-items: flex-start; padding-top: 56px; }
  .auth-mobile-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -.02em;
    color: var(--ink);
    margin-bottom: 36px;
  }
  .auth-mobile-logo .auth-logo-mark { background: var(--primary-soft); border-color: #b8ebd7; }
}