/* ===========================================================
   Honey Go Playground — shared theme
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
  --honey-gold:   #F5A300;
  --honey-amber:  #C6720A;
  --honey-deep:   #8A4B08;
  --hive-brown:   #2E1D0F;
  --cream-wax:    #FFF7E8;
  --wax-card:     #FFFDF7;
  --wax-line:     rgba(198, 114, 10, 0.10);
  --wax-line-2:   rgba(198, 114, 10, 0.06);
  --ink:          #2B1B0E;
  --ink-soft:     #6E5A46;
  --success:      #6E8F3F;
  --success-bg:   #EEF3E3;
  --error:        #B23A1F;
  --error-bg:     #FBE9E3;
  --info:         #8A4B08;
  --info-bg:      #FFF1D8;
  --shadow-soft:  0 10px 30px rgba(138, 75, 8, 0.14);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: 'Nunito Sans', sans-serif;
  color: var(--ink);
  background-color: var(--cream-wax);
}

body {
  background-image:
    linear-gradient(30deg, var(--wax-line) 12%, transparent 12.5%, transparent 87%, var(--wax-line) 87.5%, var(--wax-line)),
    linear-gradient(150deg, var(--wax-line) 12%, transparent 12.5%, transparent 87%, var(--wax-line) 87.5%, var(--wax-line)),
    linear-gradient(30deg, var(--wax-line) 12%, transparent 12.5%, transparent 87%, var(--wax-line) 87.5%, var(--wax-line)),
    linear-gradient(150deg, var(--wax-line) 12%, transparent 12.5%, transparent 87%, var(--wax-line) 87.5%, var(--wax-line)),
    linear-gradient(60deg, var(--wax-line-2) 25%, transparent 25.5%, transparent 75%, var(--wax-line-2) 75%, var(--wax-line-2)),
    linear-gradient(60deg, var(--wax-line-2) 25%, transparent 25.5%, transparent 75%, var(--wax-line-2) 75%, var(--wax-line-2));
  background-size: 44px 76px;
  background-position: 0 0, 0 0, 22px 38px, 22px 38px, 0 0, 22px 38px;
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  color: var(--hive-brown);
  margin: 0;
}

a { color: var(--honey-amber); }

/* ---------- layout shells ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--wax-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(198, 114, 10, 0.12);
  padding: 40px 36px 32px;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(245,163,0,0.28), transparent 70%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
  background: linear-gradient(155deg, var(--honey-gold), var(--honey-amber));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -4px 6px rgba(138,75,8,0.35);
}

.brand-badge svg { width: 22px; height: 22px; }

.brand-text .eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--honey-amber);
  font-weight: 800;
  display: block;
}

.brand-text h1 {
  font-size: 21px;
  line-height: 1.1;
}

.auth-card h2 {
  font-size: 26px;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 26px;
}

/* ---------- form ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--hive-brown);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 5px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(138, 75, 8, 0.22);
  background: #fffefb;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: #C9B79E; }

.field input:focus {
  border-color: var(--honey-gold);
  box-shadow: 0 0 0 3px rgba(245, 163, 0, 0.18);
}

.field input.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(178, 58, 31, 0.14);
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn-honey {
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 13px 18px;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  font-size: 15.5px;
  color: #2E1D0F;
  border-radius: 999px;
  background: linear-gradient(155deg, var(--honey-gold), var(--honey-amber));
  box-shadow: 0 8px 18px rgba(198, 114, 10, 0.35), inset 0 -3px 0 rgba(138,75,8,0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  margin-top: 6px;
  position: relative;
}

.btn-honey:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-honey:active { transform: translateY(0); box-shadow: 0 4px 10px rgba(198,114,10,0.35), inset 0 -2px 0 rgba(138,75,8,0.35); }

.btn-honey:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-honey .spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid rgba(46,29,15,0.35);
  border-top-color: #2E1D0F;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.switch-line {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--ink-soft);
}

.switch-line a { font-weight: 700; text-decoration: none; }
.switch-line a:hover { text-decoration: underline; }

/* ---------- toast / message system ---------- */

#toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  width: calc(100% - 40px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  line-height: 1.4;
  border: 1px solid transparent;
  animation: toast-in 0.25s ease forwards;
  background: var(--wax-card);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast.hide { animation: toast-out 0.2s ease forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px); }
}

.toast .icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 800;
  margin-top: 1px;
}

.toast .content strong {
  display: block;
  margin-bottom: 2px;
  font-family: 'Fraunces', serif;
  font-size: 14.5px;
}

.toast .content .fix {
  color: var(--ink-soft);
  font-size: 12.5px;
  margin-top: 3px;
  display: block;
}

.toast .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1;
  padding: 2px;
}

.toast.error { border-color: rgba(178,58,31,0.25); }
.toast.error .icon { background: var(--error-bg); color: var(--error); }
.toast.error strong { color: var(--error); }

.toast.success { border-color: rgba(110,143,63,0.3); }
.toast.success .icon { background: var(--success-bg); color: var(--success); }
.toast.success strong { color: var(--success); }

.toast.info { border-color: rgba(138,75,8,0.2); }
.toast.info .icon { background: var(--info-bg); color: var(--info); }
.toast.info strong { color: var(--info); }

/* ---------- inline field errors ---------- */

.field-error {
  color: var(--error);
  font-size: 12.5px;
  margin-top: 6px;
  display: none;
}

.field-error.show { display: block; }

/* ---------- dashboard ---------- */

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--wax-card);
  border-bottom: 1px solid rgba(198,114,10,0.12);
}

.app-nav .brand { margin-bottom: 0; }
.app-nav .brand-badge { width: 36px; height: 36px; }
.app-nav .brand-text h1 { font-size: 17px; }

.btn-ghost {
  border: 1.5px solid rgba(138,75,8,0.3);
  background: transparent;
  color: var(--honey-deep);
  font-weight: 700;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-ghost:hover { background: rgba(245,163,0,0.1); }

.dashboard-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.welcome-card {
  background: linear-gradient(155deg, #FFEFD1, #FFF7E8);
  border: 1px solid rgba(198,114,10,0.15);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-card::after {
  content: "🍯";
  position: absolute;
  font-size: 90px;
  opacity: 0.12;
  right: 10px;
  top: -10px;
}

.welcome-card .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 800;
  color: var(--honey-amber);
}

.welcome-card h2 { font-size: 28px; margin-top: 6px; }
.welcome-card p { color: var(--ink-soft); margin-top: 8px; max-width: 480px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--wax-card);
  border: 1px solid rgba(198,114,10,0.12);
  border-radius: 12px;
  padding: 18px;
}

.stat-card .label {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card .value {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  margin-top: 6px;
  color: var(--hive-brown);
  word-break: break-word;
}

.profile-card {
  background: var(--wax-card);
  border: 1px solid rgba(198,114,10,0.12);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.profile-card h3 { font-size: 17px; margin-bottom: 14px; }

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(198,114,10,0.08);
  font-size: 14.5px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row .k { color: var(--ink-soft); }
.profile-row .v { font-weight: 700; color: var(--hive-brown); }

.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--ink-soft);
}

.loading-screen .spinner-big {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(198,114,10,0.2);
  border-top-color: var(--honey-amber);
  animation: spin 0.8s linear infinite;
}

@media (max-width: 520px) {
  .row-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 22px 26px; }
}
