@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil:wght@400;600;700&display=swap');

:root {
  color-scheme: light;
  --brown: #713b12;
  --deep-brown: #48270f;
  --gold: #e9bd62;
  --paper: rgba(255, 250, 235, 0.97);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px 48px;
  color: #3e2413;
  font-family: Arial, sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 190, 94, 0.52), transparent 42%),
    radial-gradient(ellipse at 8% 92%, rgba(150, 71, 21, 0.42), transparent 34%),
    linear-gradient(145deg, #39200f 0%, #704316 48%, #3e2413 100%);
}

.site-header {
  width: min(960px, 100%);
  margin: 0 auto 28px;
  padding: 22px 28px;
  border: 2px solid var(--gold);
  border-radius: 30px;
  background: rgba(112, 61, 18, 0.90);
  color: #fff;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
}

.home-header {
  padding: 22px 28px;
}

.home-menu-bar {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 31;
  width: min(960px, 100%);
  margin: 0 auto 10px;
}

.site-menu {
  position: relative;
  z-index: 32;
}

.menu-toggle {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.menu-toggle::-webkit-details-marker {
  display: none;
}

.menu-toggle span {
  margin-top: -5px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.menu-toggle:hover,
.site-menu[open] .menu-toggle {
  background: rgba(255, 255, 255, 0.16);
}

.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  max-width: min(280px, 100%);
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #e4c67f;
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  text-align: left;
}

.site-menu[open] .menu-panel {
  position: fixed;
  top: 238px;
  right: max(18px, calc((100vw - 960px) / 2));
  width: min(320px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  max-height: min(70vh, 520px);
  z-index: 33;
  margin: 0;
  overflow-y: auto;
  animation: menu-appear 140ms ease-out;
}

body:has(.site-menu[open])::before {
  position: fixed;
  z-index: 30;
  background: rgba(30, 18, 8, 0.32);
  content: "";
  inset: 0;
}

@keyframes menu-appear {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-panel a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
}

.menu-panel .about-menu-link > span {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.menu-panel .menu-options a > span {
  text-decoration: none;
}

.menu-panel .about-menu-link.after-authenticated-menu {
  margin-top: 7px;
  padding-top: 14px;
  border-top: 1px solid #e4d4b7;
}

.menu-panel a:hover {
  background: #f7edda;
}

.menu-panel [lang="ta"] {
  font-family: "Noto Sans Tamil", "Latha", sans-serif;
  font-size: 0.9rem;
}

.menu-options {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-options a {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.menu-option-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid #e4c67f;
  border-radius: 50%;
  background: #fbf3e3;
  font-size: 1rem;
}

@media (min-width: 700px) {
  .site-menu[open] .menu-panel {
    width: min(520px, calc(100vw - 36px));
    max-height: min(70vh, 520px, calc(100vh - 254px));
  }

  .menu-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 6px;
  }

  .menu-options li:last-child {
    grid-column: 1 / -1;
  }
}

.section-card {
  text-align: center;
}

.section-card h2 {
  margin: 8px 0 12px;
  color: var(--brown);
}

.section-message {
  color: #684923;
  line-height: 1.6;
}

.site-header h1,
.site-header .tamil-heading {
  margin: 0;
  color: #fff;
  font-size: clamp(1.3rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
}

.site-header .tamil-heading {
  margin-top: 7px;
  font-family: "Noto Sans Tamil", "Latha", sans-serif;
}

.home-card,
.form-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px;
  border: 2px solid #d4a64f;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.about-card {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 30px clamp(20px, 5vw, 54px);
  border: 2px solid #d4a64f;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.dashboard-about {
  margin-top: 24px;
}

.about-back {
  margin: 0 0 20px;
  font-weight: 700;
}

.about-section {
  color: #4c3521;
  line-height: 1.75;
}

.about-section + .about-section {
  margin-top: 32px;
  padding-top: 30px;
  border-top: 1px solid #e4d4b7;
}

.about-section h2 {
  margin: 12px 0 18px;
  color: var(--brown);
  font-size: clamp(1.45rem, 4vw, 2rem);
  line-height: 1.4;
}

.about-section p {
  margin: 0 0 15px;
}

.tamil-about {
  font-family: "Noto Sans Tamil", "Latha", sans-serif;
  line-height: 2;
}

.tamil-about .eyebrow {
  font-size: 0.9rem;
}

.motto {
  margin-top: 22px !important;
  padding: 15px 18px;
  border: 1px solid #e4c67f;
  border-radius: 14px;
  background: #fbf3e3;
  color: var(--brown);
  font-weight: 700;
}

.motto span {
  color: #ac791f;
  padding: 0 3px;
}

[hidden] {
  display: none !important;
}

.home-card {
  text-align: center;
}

.home-card h2,
.form-card h2 {
  margin: 0 0 22px;
  color: var(--brown);
  text-align: center;
}

.form-card h3 {
  margin: 0 0 10px;
  color: var(--brown);
  text-align: center;
}

.member-welcome {
  margin-bottom: 12px !important;
  color: var(--brown);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.4;
}

.president-intro {
  margin-top: -12px;
  color: #684923;
}

.signup-card {
  width: min(620px, 100%);
  padding: 32px;
}

.signup-intro {
  margin-bottom: 26px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #e4c67f;
  border-radius: 999px;
  background: #f7edda;
  color: #744414;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.signup-intro h2 {
  margin: 14px 0 7px;
  font-size: 1.7rem;
}

.signup-subtitle {
  margin: 0;
  color: #684923;
}

.signup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.form-field {
  min-width: 0;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  margin: 0 0 7px;
}

.field-hint {
  margin: 6px 0 0;
  color: #684923;
  font-size: 0.86rem;
}

.verification-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 22px;
  padding: 13px 15px;
  border: 1px solid #e5cf9d;
  border-radius: 12px;
  background: #fbf3e3;
}

.verification-icon {
  color: #8b4c18;
  font-size: 1.2rem;
  line-height: 1.2;
}

.verification-note p {
  margin: 0;
  color: #684923;
  font-size: 0.92rem;
  line-height: 1.5;
}

.signup-submit {
  margin-top: 20px;
}

.signup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e4d4b7;
}

.signup-footer p {
  margin: 0;
}

.signup-footer .back-link {
  margin-top: 0;
}

.president-link {
  display: block;
  margin: 0 0 18px;
  color: var(--brown);
  font-weight: 700;
}

label {
  display: block;
  margin: 15px 0 7px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b99b70;
  border-radius: 9px;
  background: #fff;
  color: #2f2116;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(212, 166, 79, 0.35);
  border-color: #8b4c18;
}

.button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  background: #8b4c18;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.button {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
}

.secondary-button {
  flex: 0 0 auto;
  padding: 10px 12px;
}

.full-button {
  width: 100%;
  margin-top: 12px;
}

.field-hint {
  margin: 6px 0 0;
  color: #684923;
  font-size: 0.9rem;
}

.home-note {
  margin: 20px 0 0;
  color: #684923;
  font-size: 0.92rem;
}

.button:hover,
.secondary-button:hover {
  background: var(--deep-brown);
}

.button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.otp-row {
  display: flex;
  gap: 9px;
  align-items: stretch;
}

.otp-row input {
  min-width: 0;
  flex: 1;
}

.status {
  min-height: 1.25em;
  margin: 8px 0 0;
  color: #583514;
  font-size: 0.94rem;
}

.form-note {
  margin: 20px 0 12px;
  text-align: center;
}

.back-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--brown);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #d4a64f;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px 32px;
  }

  .site-header {
    padding: 18px 14px;
    border-radius: 22px;
  }

  .home-header {
    padding: 18px 14px;
  }

  .site-menu[open] .menu-panel {
    top: 198px;
    right: 12px;
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 78px);
  }

  .about-card {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .tamil-about {
    line-height: 1.9;
  }

  .home-card,
  .form-card {
    padding: 22px 18px;
  }

  .signup-grid {
    grid-template-columns: 1fr;
  }

  .signup-card {
    padding: 22px 18px;
  }

  .form-field-full {
    grid-column: auto;
  }

  .signup-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .otp-row {
    flex-direction: column;
  }
}
