html {
  background-color: #080808; /* Matches top of mobile SVG for Safari status bar */
  height: 100%;
}

@font-face {
  font-family: 'CustomFont';
  src: url('elron.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================
   1. BASE STYLES (Default / Desktop)
   ========================================================== */

body {
  font-family: 'CustomFont', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: #080808 url('background.svg') no-repeat center center / cover;
  color: #ffffff;
  padding: 2rem 1rem 25vh 1rem;
}

.form-container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

#signupForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  background: rgba(217, 217, 217, 0.85);
  border-radius: 50px;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

input[type="email"],
button {
  font-family: 'CustomFont', system-ui, -apple-system, sans-serif;
}

input[type="email"] {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #333333;
  outline: none;
  text-align: center;
  line-height: normal;
  position: relative;
  top: 1px;
}

.button-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 3px solid #000000;
}

button {
  height: 100%;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0 1.6rem;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  position: relative;
  top: 1px;
}

/* Autofill fixes */
input[type="email"]::-webkit-autofill-preview,
input[type="email"]:-webkit-autofill-preview {
  font-family: 'CustomFont', system-ui, -apple-system, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em !important;
}

input[type="email"]:-webkit-autofill,
input[type="email"]:-webkit-autofill:hover,
input[type="email"]:-webkit-autofill:focus,
input[type="email"]:-webkit-autofill:active {
  font-family: 'CustomFont', system-ui, -apple-system, sans-serif !important;
  -webkit-box-shadow: 0 0 0 30px rgba(217, 217, 217, 0) inset !important;
  -webkit-text-fill-color: #333333 !important;
  transition: background-color 5000s ease-in-out 0s;
}

input[type="email"]::placeholder {
  color: #777777;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

button:hover {
  background: #ffffff;
}

button:active {
  opacity: 0.8;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
}

.success-msg {
  color: #10b981;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: none;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: 0px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================
   2. TABLET STYLES (Screens up to 1024px wide)
   ========================================================== */
@media (max-width: 1024px) {
  body {
    padding-bottom: 20vh;
  }
}

/* ==========================================================
   3. MOBILE STYLES (Screens up to 768px wide)
   ========================================================== */
@media (max-width: 768px) {
  html {
    background-color: #080808;
    height: auto; /* Allows natural scrolling */
    min-height: 100%;
  }

  body {
    /* Set background directly on body without 'fixed' */
    background: #080808 url('background-mobile.svg') no-repeat top center;
    background-size: 100% auto; /* Fits full width, lets height expand naturally */

    min-height: 100vh;
    min-height: 100dvh;

    /* Enables scrolling if background/content is taller than screen */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    justify-content: flex-start !important;

    /* Spacing from the top notch */
    padding-top: calc(50vh + env(safe-area-inset-top));
    padding-bottom: calc(0vh + env(safe-area-inset-bottom));
  }

  .form-container {
    max-width: 90%;
  }

  input[type="email"] {
    font-size: 0.7rem;
    padding: 0 0.8rem;
  }

  button {
    padding: 0 1dvi;
    font-size: 0.7rem;
  }
}
