/* 1. Use a more-intuitive box-sizing model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
*:not(dialog) {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input,
button,
textarea,
select {
  font: inherit;
}

/* 8. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  text-wrap: balance;
}

/*
  10. Create a root stacking context
*/
#root,
#__next {
  isolation: isolate;
}

button {
  border: none;
}

:root {
  --bg-primary: oklch(96.7% 0.001 286.375);
  --text-primary: #18181b;
  --input-border: #ccc;
}

[data-theme="dark"] {
  --bg-primary: #18181b;
  --text-primary: oklch(96.7% 0.001 286.375);
  --input-border: #333;
}

[data-theme="light"] {
  --bg-primary: oklch(96.7% 0.001 286.375);
  --text-primary: #18181b;
  --input-border: #ccc;
}

:root[data-theme="light"] .icon {
  filter: invert(100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-primary: #18181b;
    --text-primary: oklch(96.7% 0.001 286.375);
    --input-border: #333;
  }
}

html {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

.bg-img-container {
  width: 60%;
  flex-shrink: 0;
  position: relative;
  padding: 1rem;
  border-radius: 2rem;
  overflow: hidden;
}

.logo {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  width: clamp(96px, 10vw, 160px);
  height: auto;
  z-index: 20;
}

.bg-img {
  width: 100%;
  height: calc(100vh - 2rem);
  object-fit: cover;
  object-position: 20%;
  border-radius: 2rem;
}

.hero-overlay {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  width: auto;
  padding: 4.5rem 3rem 2.5rem 3rem;
  z-index: 10;
  border-radius: 0rem 0rem 2rem 2rem;

  color: white;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

.hero-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 0rem 0rem 2rem 2rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.65) 10%,
    rgba(0, 0, 0, 0.35) 50%,
    transparent 100%
  );
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(to top, black 50%, transparent 100%);
  mask-image: linear-gradient(to top, black 50%, transparent 100%);
  pointer-events: none;
}

.hero-overlay h2 {
  font-size: clamp(2.5rem, 3vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-overlay p {
  font-size: clamp(1.1rem, 1.2vw, 1.35rem);
  opacity: 0.9;
  max-width: 48ch;
}

.bg-img-credit {
  margin-top: 1rem;
  font-size: 0.8rem;
  opacity: 0.5;
  color: white;
}

a,
a:visited {
  text-decoration: none;
  color: lightblue;
}

:root[data-theme="light"] .login-link a {
  color: blue;
}

:root[data-theme="light"] .terms-policies a {
  color: blue;
}

main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 4rem;
}

.theme-dropdown {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

#theme-icon-btn {
  background-color: var(--bg-primary);
  border-radius: 0.375rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: background-color 0.2s;
}

#theme-icon-btn:hover {
  background-color: #8080801a;
}

#theme-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.3125rem);
  right: 0;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  border-radius: 0.375rem;
  padding: 0.5rem;
  list-style: none;
  min-width: 7.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}

#theme-menu button {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem;
  background: transparent;
  border-radius: 0.25rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

#theme-menu button:hover {
  background-color: rgba(128, 128, 128, 0.2);
}

#theme-menu.show {
  display: block;
}

.form {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transform: scale(1.2);
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
}

input {
  padding: 0.5rem;
  border: 1px solid var(--input-border);
  border-radius: 0.25rem;
  background-color: transparent;
  color: inherit;
}

:root[data-theme="dark"] input {
  border: 1px solid #333;
}

input:focus {
  outline: 2px solid lightblue;
}

:root[data-theme="light"] input:focus {
  outline: 2px solid blue;
}

.touched:invalid {
  outline: 2px solid red;
}

input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--bg-primary) inset !important;
  -webkit-text-fill-color: white !important;
}

.submit-btn {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0.375rem;
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
  transition: all 0.3 ease-in-out;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-link, .terms-policies {
  text-align: center;
}
