
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111111;
  --surface-hover: #1b1b1b;
  --text: #f5f5f7;
  --muted: #929299;
  --border: #292929;
  --accent: #ffffff;
  --input-bg: #101010;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.light-theme {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-hover: #ededf0;
  --text: #171719;
  --muted: #77777f;
  --border: #dddddf;
  --accent: #171719;
  --input-bg: #f5f5f7;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#app {
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

.app-header {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-controls button {
  min-width: 40px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
}

.brand {
  text-align: right;
}

.brand-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: 1px;
}

.brand-tagline {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 1.4px;
}

main {
  flex: 1;
  padding: 35px 0;
}

#welcomeScreen {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.welcome-content {
  text-align: center;
  padding: 22px 0 30px;
}

.welcome-content h1 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 650;
}

.welcome-content p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.auth-switch {
  display: flex;
  gap: 5px;
  padding: 5px;
  margin-bottom: 25px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.auth-switch button {
  flex: 1;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.auth-switch button.active {
  color: var(--text);
  background: var(--surface-hover);
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

form h2,
.account-content h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
}

form label {
  margin-top: 5px;
  font-size: 13px;
  color: var(--muted);
}

form input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  text-align: start;
}

form input:focus {
  border-color: var(--muted);
}

form button[type="submit"] {
  min-height: 49px;
  margin-top: 12px;
  padding: 12px;
  color: #000000;
  background: #ffffff;
  border: 0;
  border-radius: 13px;
  font-weight: 650;
}

body.light-theme form button[type="submit"] {
  color: #ffffff;
  background: #171719;
}

.name-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.name-fields > div {
  min-width: 0;
}

#loginMessage,
#signupMessage,
#accountMessage {
  min-height: 0;
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.account-heading {
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.account-heading h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 2px;
}

.account-heading p {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.5px;
}

.account-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 25px 0;
}

.account-content > p {
  overflow-wrap: anywhere;
}

.account-content button,
#bottomNavigation button {
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  background: var(--surface);
}

.account-content button:active,
#bottomNavigation button:active,
.header-controls button:active {
  background: var(--surface-hover);
}

#logoutButton {
  margin-top: 10px;
}

#bottomNavigation {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 20px auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
}

#bottomNavigation button {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.app-footer {
  padding: 18px 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 380px) {
  #app {
    padding: 0 14px;
  }

  .brand-title {
    font-size: 20px;
  }

  .brand-tagline {
    font-size: 8px;
  }

  .name-fields {
    grid-template-columns: 1fr;
  }

  #bottomNavigation button {
    padding: 8px;
  }
}
