:root {
  --bg: #f4efe6;
  --surface: rgba(255,255,255,0.94);
  --surface-strong: #ffffff;
  --text: #2f241b;
  --muted: #6d5d51;
  --border: #ddcfbf;
  --border-strong: #b89972;
  --accent: #8a5a2b;
  --accent-strong: #6c431d;
  --accent-soft: #f5ede2;
  --success: #2f6b3a;
  --danger: #9e2a2b;
  --shadow: 0 18px 40px rgba(44, 28, 15, 0.12);
  --radius: 22px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(186,142,90,0.16), transparent 30%),
    linear-gradient(180deg, #f8f4ed 0%, var(--bg) 100%);
  line-height: 1.65;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, Arial, sans-serif;
  text-align: left;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #4c2b10; }

#wrapper-header,
#wrapper-menu,
#footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-left: auto;
  margin-right: auto;
}

#wrapper-header {
  margin-top: 1.25rem;
}

#header {
  min-height: 240px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(28,17,10,0.80) 0%, rgba(28,17,10,0.50) 44%, rgba(28,17,10,0.08) 75%),
    url('images/banner.jpg') center right / cover no-repeat,
    #22170f;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

#header h1 {
  margin: 0;
  color: #fffaf4;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  max-width: 10ch;
  text-shadow: 0 3px 18px rgba(0,0,0,0.28);
}
#header h1::before {
  content: "John's Clock Repairs";
  display: block;
}

#wrapper-menu {
  margin-top: 1rem;
}

#menu {
  background: rgba(53, 35, 20, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
}
#menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
#menu li { display: block; }
#menu a:link,
#menu a:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.15rem;
  border-radius: 12px;
  color: #fff8ef;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color .2s ease, transform .2s ease, color .2s ease;
}
#menu a:hover,
#menu a:focus {
  background: rgba(255,255,255,0.12);
  color: #fff;
  transform: translateY(-1px);
}

#content {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 1rem auto 1.5rem auto;
  padding: clamp(1.35rem, 2vw, 2rem);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

h1 {
  margin: 0 0 1rem 0;
  color: var(--accent-strong);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

#content > h1:first-child {
  margin-bottom: 0.35rem;
}

h2 {
  margin: 2rem 0 0.85rem 0;
  color: var(--text);
  font-size: clamp(1.3rem, 3vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  margin: 1.3rem 0 0.7rem 0;
  font-size: 1.1rem;
  color: var(--accent-strong);
}

p {
  margin: 0 0 1rem 0;
  max-width: 75ch;
}

ul {
  margin: 0.2rem 0 1.4rem 1.25rem;
  padding: 0;
}
li { margin-bottom: 0.6rem; }

#content table:not(.mFrame) {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#footer {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: rgba(53, 35, 20, 0.92);
  color: #f3e6d8;
  box-shadow: var(--shadow);
  text-align: right;
  letter-spacing: 0.04em;
  font-size: 0.88rem;
}

.notice,
.alert,
.success-message {
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.25rem 0;
}
.alert {
  background: #fff1f1;
  border: 1px solid #efcaca;
  color: var(--danger);
}
.notice {
  background: var(--accent-soft);
  border: 1px solid var(--border);
}
.success-message {
  background: #eff8f0;
  border: 1px solid #cce4cf;
  color: var(--success);
}

.panel,
.form-shell,
.iframe-shell,
.promo-grid {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: 0 10px 25px rgba(44,28,15,0.08);
}

.panel,
.form-shell,
.iframe-shell {
  padding: 1.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.25rem 0 0.5rem 0;
}

.button,
.button:link,
.button:visited,
input[type="submit"],
input[type="button"],
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.2rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #9d6937 0%, #7f5128 100%);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(117,74,37,0.22);
}
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
  background: linear-gradient(180deg, #86572c 0%, #6c431d 100%);
  color: #fff;
}

.two-column {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.25rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0 1.5rem;
}

.info-card {
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf9 0%, #f8f1e8 100%);
  border: 1px solid var(--border);
}
.info-card h3 {
  margin-top: 0;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
  margin-top: 1rem;
}
.promo-item {
  padding: 1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff 0%, #fbf6ef 100%);
  border: 1px solid var(--border);
  text-align: center;
}
.promo-item img {
  max-height: 110px;
  width: auto;
  object-fit: contain;
  margin-bottom: 0.7rem;
}
.promo-item p {
  max-width: none;
  margin-bottom: 0;
}

form {
  margin-top: 1rem;
}
.form-shell table,
.form-shell tr,
.form-shell td {
  display: block;
  width: 100%;
}
.form-shell > table > tbody > tr:first-child {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 1rem;
}
.form-shell > table > tbody > tr:first-child > td {
  min-width: 0;
}
.form-shell table table tr {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: start;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.form-shell table table td {
  padding: 0;
}
label,
.form-shell td:first-child {
  font-weight: 600;
  color: var(--text);
}
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border: 1px solid #cfbeaa;
  border-radius: 12px;
  font: inherit;
  color: var(--text);
  background: #fffdf9;
}
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(138, 90, 43, 0.12);
}
textarea {
  min-height: 220px;
  resize: vertical;
}

.iframe-shell iframe {
  width: 100%;
  min-height: 78vh;
  border: 0;
  border-radius: 18px;
  background: #fff;
}

.spam-table,
.spam-table tr,
.spam-table td {
  display: table !important;
  width: auto !important;
}
.spam-table tr {
  display: table-row !important;
}
.spam-table td {
  display: table-cell !important;
  vertical-align: middle;
}
.spam-table input[name="spamchars"] {
  max-width: 80px;
}

TABLE.mFrame {
  BORDER-RIGHT: #8a5a2b 1px solid;
  BORDER-TOP: #8a5a2b 1px solid;
  BORDER-LEFT: #8a5a2b 1px solid;
  BORDER-BOTTOM: #8a5a2b 1px solid;
  BACKGROUND-COLOR: #FFFFFF;
}
TABLE.mFrame TH {
  FONT-SIZE: 8pt;
  BACKGROUND: #8a5a2b;
  BORDER-BOTTOM: #8a5a2b 1px solid;
  COLOR: #FFFFFF;
  TEXT-ALIGN: left;
  PADDING-LEFT: 6px;
  PADDING-BOTTOM: 1px;
  HEIGHT: 21px;
}
TABLE.mFrame TD.footer {
  FONT-SIZE: 8pt;
  BORDER-TOP: #8a5a2b 1px solid;
  BACKGROUND-COLOR: #f5ede2;
  COLOR: #000000;
  TEXT-ALIGN: left;
}
TABLE.mFrame TD {
  FONT-SIZE: 8pt;
  VERTICAL-ALIGN: top;
}
TABLE.mFrame TD.nav {
  FONT-SIZE: 10pt;
  BORDER-BOTTOM: #8a5a2b 1px solid;
  BACKGROUND-COLOR: #f4efe6;
  TEXT-ALIGN: left;
  VERTICAL-ALIGN: middle;
}

@media (max-width: 860px) {
  #header {
    min-height: 180px;
    padding: 1.35rem;
    background-position: 72% center;
  }
  .two-column,
  .form-shell > table > tbody > tr:first-child,
  .promo-grid {
    grid-template-columns: 1fr;
  }
  .form-shell table table tr {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  #footer {
    text-align: left;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }
  #wrapper-header,
  #wrapper-menu,
  #content,
  #footer {
    width: min(calc(100% - 1rem), var(--max-width));
  }
  #menu a:link,
  #menu a:visited {
    width: 100%;
    justify-content: flex-start;
  }
}
