/* Nirwana Bug Report — shared styles */

:root {
  --ink: #0d0d0d;
  --ink-soft: #2c2c2c;
  --paper: #ffffff;
  --line: #e6e6e6;
  --line-strong: #d4d4d4;
  --muted: #767676;
  --panel: #f4f4f2;
  --accent: #0d0d0d;
  --error: #c22a20;
  --error-bg: #fdecea;
  --error-line: #f3c6c2;
  --ok: #157a3d;
  --ok-bg: #eaf7ef;
  --ok-line: #bfe6cd;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 12px 32px -16px rgba(0,0,0,0.18);
  --shadow-deep: inset 0 1px 0 rgba(255,255,255,0.6), 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px -6px rgba(0,0,0,0.10), 0 24px 48px -20px rgba(0,0,0,0.22);
  --font: "Urbanist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 15% -10%, #ffffff 0%, var(--panel) 55%),
    var(--panel);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px, 5vw, 56px) 16px 40px;
  -webkit-font-smoothing: antialiased;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(20px, 4vw, 32px);
}

.brand img {
  height: 26px;
  width: auto;
}

.shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.card {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
  padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 36px) clamp(24px, 4vw, 32px);
  animation: card-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

.card.form-card { max-width: 620px; }
.card.login-card { max-width: 380px; }

h1 {
  font-size: clamp(20px, 3.4vw, 24px);
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 26px;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 18px 0 6px;
}

label:first-of-type { margin-top: 0; }

label .optional {
  font-weight: 400;
  color: var(--muted);
}

.field-group {
  margin-top: 18px;
}
.field-group:first-child { margin-top: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.field-row .field-group { margin-top: 0; }

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field-group + .field-group { margin-top: 18px; }
}

.section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.section-label + .field-group,
.section-label + .field-row {
  margin-top: 0;
}

input[type="text"],
input[type="password"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 12px 13px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23767676'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.293l3.71-4.06a.75.75 0 111.08 1.04l-4.24 4.65a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 38px;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}

input::placeholder, textarea::placeholder { color: #a8a8a8; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13,13,13,0.08);
}

.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  position: relative;
}

.file-drop-icon {
  display: block;
  margin: 0 auto 8px;
  color: var(--muted);
  transition: color 0.15s ease, transform 0.15s ease;
}

.file-drop:hover .file-drop-icon {
  transform: translateY(-1px);
}

.file-drop.dragover {
  border-color: var(--ink);
  background: #f0f0f0;
  color: var(--ink-soft);
  transform: translateY(-1px);
}

.file-drop.dragover .file-drop-icon {
  color: var(--ink);
  transform: translateY(-2px);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop .hint { display: block; margin-top: 2px; font-size: 12px; }
.file-list {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.file-tile {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.file-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(0,0,0,0.25);
  border-color: var(--line-strong);
}
.file-preview {
  height: 78px;
  background: #ececec;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-inner img,
.preview-inner video,
.preview-inner object {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  background: #ececec;
}
.media-badge {
  position: absolute;
  left: 5px;
  bottom: 5px;
  background: rgba(13, 13, 13, 0.72);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  letter-spacing: 0.03em;
  pointer-events: none;
}
.file-icon {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.file-meta {
  padding: 6px 8px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.file-name {
  font-size: 11px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-size {
  font-size: 10px;
  color: var(--muted);
}
.file-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(13, 13, 13, 0.72);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  z-index: 1;
  transition: background 0.15s ease;
}
.file-remove:hover { background: #000; }

.password-wrap {
  position: relative;
}
.password-wrap input { padding-right: 44px; }

input[type="password"] {
  font-size: 22px;
  letter-spacing: 0.14em;
}
input[type="password"]::placeholder {
  font-size: 16px;
  letter-spacing: normal;
}

.toggle-visibility {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  margin: 0;
  width: auto;
}
.toggle-visibility:hover { color: var(--ink); }

button.primary {
  margin-top: 26px;
  width: 100%;
  padding: 14px 16px;
  background: var(--accent);
  color: var(--paper);
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.12s ease, box-shadow 0.2s ease;
}
button.primary:hover { background: #262626; box-shadow: 0 6px 16px -8px rgba(0,0,0,0.4); }
button.primary:active { transform: scale(0.99); }
button.primary:disabled {
  background: #b6b6b6;
  cursor: not-allowed;
}

button.secondary {
  margin-top: 12px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
button.secondary:first-of-type { margin-top: 26px; }
button.secondary:hover { background: var(--panel); border-color: var(--ink); }
button.secondary:disabled { color: var(--muted); cursor: default; }

.thankyou-actions {
  display: flex;
  flex-direction: column;
}

.thankyou-icon {
  display: block;
  margin: 4px auto 14px;
  color: var(--ok);
}

#thankyou-view h1,
#thankyou-view .subtitle {
  text-align: center;
}

.ticket-badge {
  display: block;
  width: fit-content;
  margin: 4px auto 0;
  padding: 8px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ticket-badge:hover { border-color: var(--ink); background: var(--panel); }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
  display: none;
}
button.primary.loading .spinner { display: inline-block; }
button.primary.loading .btn-label { opacity: 0.85; }

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

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

.shake { animation: shake 0.35s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 10px) scale(0.97);
  min-width: 260px;
  max-width: calc(100vw - 32px);
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast.ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok-line); }
.toast.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-line); }
.toast a { color: inherit; font-weight: 700; text-decoration: underline; }
.toast-icon { flex: none; margin-top: 1px; }
.toast-body { flex: 1; min-width: 0; }

.form-banner {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: none;
}
.form-banner.error { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-line); }

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 22px;
}
.footer-note a { color: var(--ink-soft); }

.top-bar {
  width: 100%;
  max-width: 620px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 14px;
}
.top-bar .brand { margin: 0; }
.top-bar .brand img { height: 20px; }
.logout-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line-strong);
  padding: 6px 12px;
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.logout-link:hover { color: var(--ink); border-color: var(--ink); }

textarea {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-thumb {
  background-color: var(--line-strong);
  border-radius: 8px;
  border: 2px solid var(--paper);
}
textarea::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

@media (max-width: 480px) {
  .card { padding: 22px 18px 24px; border-radius: 12px; }
  h1 { font-size: 19px; }
  .top-bar { max-width: 100%; }
  .section { margin-top: 22px; padding-top: 18px; }
}
