/* Sign In */
:root {
  --ink: #16302B;
  --brand: #004d40;      /* Dark teal — primary actions */
  --accent: #00796b;     /* Bright teal — links */
  --brass: #C89B5C;      /* Subtle warm accent, used sparingly */
  --ivory: #FBF8F3;      /* Warm canvas, matches the main app */
  --mist: #7C9990;
  --white: #FFFFFF;
  --line: rgba(22, 48, 43, 0.1);
  --error: #C0392B;

  --radius: 1rem;
  --radius-sm: 0.625rem;
  --shadow: 0 24px 60px -16px rgba(6, 33, 29, 0.22);
  --shadow-soft: 0 4px 16px -6px rgba(6, 33, 29, 0.12);
  --transition: 0.25s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  min-height: 100vh;
  background: var(--ivory);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: "Fraunces", Georgia, serif;
}

/* ---------- Wrapper ----------
   Mobile-first: full-bleed, no floating card, so it reads as part of
   the app rather than a modal sitting on a page. The two-column
   "premium" card treatment only appears from 850px up. */
.signin-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  max-width: 950px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--ivory);
}

/* ---------- Left Side (desktop only) ---------- */
.welcome-section {
  display: none;
  background: var(--white);
  color: var(--brand);
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
  overflow: hidden;
}

.welcome-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.nestaura-logo {
  width: 12.5rem;
  margin: 0 auto 1.5rem;
}

.welcome-eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.75rem;
}

.welcome-section h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--ink);
}

.welcome-section p {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--mist);
}

.welcome-section p strong {
  color: var(--brand);
}

/* Decorative circles — teal + a touch of brass for a two-tone accent */
.welcome-section::before,
.welcome-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.welcome-section::before {
  width: 11.25rem;
  height: 11.25rem;
  top: 15%;
  left: -3.5rem;
  background: rgba(0, 121, 107, 0.09);
}
.welcome-section::after {
  width: 14rem;
  height: 14rem;
  bottom: -4.5rem;
  right: -5rem;
  background: rgba(200, 155, 92, 0.14);
}

/* ---------- Right Side / Form ---------- */
.form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: max(2.5rem, env(safe-area-inset-top)) 1.5rem max(2rem, env(safe-area-inset-bottom));
}

.form-container {
  width: 100%;
  max-width: 21.875rem;
}

.form-container h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--ink);
}

.subtitle {
  font-size: 0.9rem;
  color: var(--mist);
  margin-bottom: 1.75rem;
}

/* ---------- Inputs ---------- */
.input-group {
  margin-bottom: 1.1rem;
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-group input::placeholder {
  color: var(--mist);
}

.input-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.15);
}

.password-input-container input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--mist);
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.password-toggle:hover {
  color: var(--brand);
  background: rgba(22, 48, 43, 0.06);
}

/* ---------- Remember / Forgot ---------- */
.remember-forgot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.remember-forgot label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.remember-forgot input[type="checkbox"] {
  accent-color: var(--brass);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.remember-forgot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.remember-forgot a:hover {
  text-decoration: underline;
}

/* ---------- reCAPTCHA ---------- */
.g-recaptcha {
  margin-bottom: 1.25rem;
  transform: scale(0.95);
  transform-origin: left top;
}

/* ---------- Buttons ---------- */
.submit-btn, .social-btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 0.15s ease;
}

.submit-btn {
  background: var(--brand);
  color: var(--white);
  margin-bottom: 1rem;
}
.submit-btn:hover {
  background: #00332e;
}
.submit-btn:active {
  transform: scale(0.98);
}
.submit-btn:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.social-btn {
  background: var(--white);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.social-btn:hover {
  background: rgba(0, 121, 107, 0.08);
}

/* ---------- Divider ---------- */
.divider {
  text-align: center;
  margin: 1.1rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03rem;
  color: var(--brass);
  position: relative;
}
.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: rgba(200, 155, 92, 0.35);
  position: absolute;
  top: 50%;
  width: 38%;
}
.divider::before { left: 0; }
.divider::after { right: 0; }

/* ---------- Sign Up Link ---------- */
.signup-link {
  font-size: 0.9rem;
  margin-top: 1.5rem;
  text-align: center;
  color: var(--mist);
}
.signup-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.signup-link a:hover {
  text-decoration: underline;
}

/* ---------- Back to Home ----------
   Icon-only on mobile (reads as a native nav button); full pill with
   label once there's room, on desktop. */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  color: var(--brand);
  border: 1px solid var(--line);
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), transform 0.2s ease;
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  left: 1rem;
  z-index: 60;
  box-shadow: var(--shadow-soft);
}
.back-home:hover {
  background: rgba(22, 48, 43, 0.06);
  transform: translateX(-2px);
}
.back-home svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.back-home span {
  display: none;
}

/* ---------- Verify banner ---------- */
#verify-banner {
  position: fixed;
  top: max(1.25rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-0.75rem);
  z-index: 400;
  width: 92%;
  max-width: 26rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--white);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#verify-banner.hidden {
  display: none;
}
#verify-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
#verify-banner.success { background: var(--brand); }
#verify-banner.error   { background: var(--error); }
#verify-banner.info    { background: var(--brass); }

/* ---------- Toast messages (showMessage()) ---------- */
.modal-message {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  max-width: 90%;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  background: var(--error);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise-up 0.3s ease;
}
.modal-message.success {
  background: var(--brand);
}
@keyframes rise-up {
  from { opacity: 0; transform: translateX(-50%) translateY(0.6rem); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ---------- Desktop: premium two-column card ---------- */
@media (min-width: 850px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
  }
  .signin-wrapper {
    grid-template-columns: 1fr 1fr;
    min-height: auto;
    background: var(--white);
    border-radius: 1.375rem;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .welcome-section {
    display: flex;
  }
  .form-section {
    min-height: auto;
    padding: 3rem;
  }
  .back-home {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius);
    background: var(--brand);
    color: var(--white);
    border: none;
    top: 1.25rem;
    left: 1.25rem;
  }
  .back-home:hover {
    background: var(--white);
    color: var(--brand);
    border: 1px solid var(--brand);
    transform: translateX(-3px);
  }
  .back-home span {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
