/* TigAlu OÜ — PWA, matches tigalu.ee dark industrial brand */

:root {
  --bg: #121214;
  --bg-elevated: #1a1a1c;
  --bg-card: #222226;
  --bg-header: rgba(18, 18, 20, 0.92);
  --border: #2e2e33;
  --border-strong: #3d3d44;
  --text: #e8e8ea;
  --text-muted: #9a9aa3;
  --text-dim: #6e6e78;
  --accent: #e8942a;
  --accent-hot: #f0a84a;
  --accent-dim: rgba(232, 148, 42, 0.14);
  --accent-glow: rgba(232, 148, 42, 0.35);
  --wa: #25d366;
  --wa-dark: #1ebe57;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Oswald", "Inter", system-ui, sans-serif;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-h: 4.25rem;
  --tab-h: 4.15rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html { height: 100%; }

body {
  min-height: 100dvh;
  padding-top: calc(var(--header-h) + var(--safe-top));
  padding-bottom: calc(var(--tab-h) + var(--safe-bot) + 0.5rem);
}

img, svg { display: block; max-width: 100%; }

a {
  color: var(--accent-hot);
  text-decoration: none;
}

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #111;
  font-weight: 600;
  border-radius: 6px;
}
.skip-link:focus { top: calc(var(--safe-top) + 0.5rem); }

.wrap {
  width: min(100% - 1.5rem, 28rem);
  margin-inline: auto;
}

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 600;
  min-width: 0;
}

.logo-plate {
  display: inline-flex;
  padding: 0.12rem;
  border-radius: 10px;
  background: linear-gradient(160deg, #f4f4f4 0%, #d8d8d8 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    0 0 0 2px rgba(57, 255, 120, 0.35),
    0 6px 16px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.logo-img {
  height: 2.7rem;
  width: auto;
  max-width: 4.6rem;
  border-radius: 8px;
  object-fit: contain;
  background: #c8c8c8;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}

.logo-ou { color: var(--text-muted); font-weight: 500; }
.logo-sub {
  display: block;
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--text-dim);
  margin-top: 0.1rem;
}

.lang-switcher {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}

.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.48rem;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

.lang-btn:hover { color: var(--text); }

.lang-btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-hot);
}

/* Views */
.view { display: none; padding: 0.95rem 0 1.25rem; }
.view.is-active { display: block; }

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

h1 { font-size: 1.7rem; text-transform: uppercase; }
h2 { font-size: 1.4rem; text-transform: uppercase; }
h3 { font-size: 1.05rem; font-family: var(--font); text-transform: none; letter-spacing: 0; }

.lead, .section-lead {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  background: var(--bg-card);
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn svg { flex-shrink: 0; }

.btn-accent {
  background: linear-gradient(180deg, var(--accent-hot), var(--accent));
  color: #1a1208;
  box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-accent:hover {
  color: #111;
  background: linear-gradient(180deg, #ffb85a, #e8942a);
  transform: translateY(-1px);
}

.btn-wa {
  background: var(--wa);
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.28);
}

.btn-wa:hover { background: var(--wa-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent-hot);
  background: var(--accent-dim);
}

.btn-block { width: 100%; }
.btn-xl {
  padding: 0.95rem 1.15rem;
  font-size: 1.05rem;
  border-radius: 14px;
  font-weight: 700;
}

.btn-camera {
  background: linear-gradient(180deg, var(--accent-hot), var(--accent));
  color: #1a1208;
  box-shadow: 0 8px 28px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  flex-direction: column;
  gap: 0.25rem;
  min-height: 5.6rem;
}

.btn-camera .btn-sub {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.8;
}

.hero-actions, .row-actions, .form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.15rem;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

/* Home preview strip */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0 0 1.15rem;
}

.preview-card {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}

.preview-card img {
  width: 100%;
  height: 7.4rem;
  object-fit: cover;
}

.preview-card figcaption {
  padding: 0.4rem 0.55rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  margin-bottom: 0.8rem;
}

.card h3 { margin-bottom: 0.45rem; }

.service-body { white-space: pre-line; color: var(--text-muted); margin: 0; font-size: 0.92rem; }

.contact-list {
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.contact-list div { display: grid; gap: 0.1rem; }
.contact-list dt { color: var(--text-dim); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.contact-list dd { margin: 0; }

.foot-note {
  margin: 1.2rem 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}


/* Form */
label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

.field { margin-bottom: 0.7rem; }

input[type="text"],
input[type="tel"],
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
}

textarea { min-height: 3.6rem; resize: vertical; }

input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.photo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 4.35rem;
  padding: 0.7rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--accent-dim);
  color: var(--accent-hot);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.photo-drop span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.7rem;
}

.thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; }

.thumb-remove {
  position: absolute;
  top: 0.25rem; right: 0.25rem;
  width: 1.5rem; height: 1.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
}

.form-error {
  display: none;
  margin: 0 0 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(200, 60, 60, 0.15);
  border: 1px solid rgba(200, 60, 60, 0.35);
  color: #ffb4b4;
  font-size: 0.88rem;
}
.form-error.is-visible { display: block; }

.hint {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Success */
.success-icon {
  width: 4rem; height: 4rem;
  margin: 0.4rem auto 1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(37, 211, 102, 0.15);
  color: var(--wa);
}

.preview-msg {
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.65rem;
  max-height: none;
  overflow: visible;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.gallery-card {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
}

.gallery-card img {
  width: 100%;
  height: 8.6rem;
  object-fit: cover;
}

.gallery-card figcaption {
  padding: 0.45rem 0.55rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.gallery-group {
  margin: 0 0 1.35rem;
}

.gallery-group h3 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  color: var(--text);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0,0,0,0.92);
  padding: 1rem;
  align-items: center;
  justify-content: center;
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 80dvh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-cap {
  position: absolute;
  left: 1rem; right: 1rem; bottom: calc(1rem + var(--safe-bot));
  text-align: center;
  color: #ddd;
  font-size: 0.85rem;
}
.lightbox-close {
  position: absolute;
  top: calc(0.7rem + var(--safe-top));
  right: 0.7rem;
  width: 2.4rem; height: 2.4rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.3rem;
}

/* Tab bar */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  height: calc(var(--tab-h) + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.35rem 0.2rem 0.25rem;
}

.tab svg { width: 1.4rem; height: 1.4rem; }
.tab.is-active { color: var(--accent-hot); }

/* Install banner */
.install-bar {
  display: none;
  position: fixed;
  left: 0.75rem; right: 0.75rem;
  bottom: calc(var(--tab-h) + var(--safe-bot) + 0.6rem);
  z-index: 70;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  align-items: center;
  gap: 0.7rem;
}
.install-bar.is-visible { display: flex; }
.install-bar p { margin: 0; flex: 1; font-size: 0.82rem; color: var(--text-muted); }
.install-bar .btn { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.install-dismiss {
  appearance: none; border: 0; background: transparent;
  color: var(--text-dim); font-size: 1.1rem; padding: 0.2rem;
}

@media (min-width: 640px) {
  .preview-grid, .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.notice {
  margin: 0 0 0.65rem;
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(232, 148, 42, 0.35);
  color: var(--accent-hot);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}
.success-icon {
  color: var(--wa);
}

#view-success .success-icon {
  width: 2.7rem;
  height: 2.7rem;
  margin: 0.15rem auto 0.45rem;
}
#view-success h1 { font-size: 1.28rem; margin-bottom: 0.3rem; }
#view-success .lead { margin-bottom: 0.5rem; font-size: 0.86rem; }
#view-success .hero-actions { gap: 0.45rem; }
#view-success .btn-xl { padding: 0.75rem 1rem; font-size: 0.98rem; }
#view-success .hint { margin: 0.1rem 0 0; font-size: 0.72rem; }
#view-success .btn-wa { padding: 0.75rem 1rem; }
#view-success .preview-msg { margin-bottom: 0.5rem; }
.btn-text {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.35rem;
  text-align: center;
  width: 100%;
}
.btn-text:hover { color: var(--accent-hot); }
#email-status.is-pending { color: var(--accent-hot); }
#email-status.is-error { color: #ffb4b4; }

.contact-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}
.contact-row.row-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.contact-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0.45rem 0.1rem 0.4rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
}
.contact-chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
}
.chip-icon svg { display: block; }
.chip-wa .chip-icon { background: #25d366; box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35); }
.chip-tg .chip-icon { background: #2aabee; }
.chip-vb .chip-icon { background: #7360f2; }
.chip-sms .chip-icon { background: #3d3d44; }
.chip-call .chip-icon { background: var(--accent); color: #1a1208; }
.chip-wa { border-color: rgba(37, 211, 102, 0.35); }
