:root {
  --accent: #0ea5a4;
  --accent-2: #06b6d4;
  --bg: #f0fbff;
  --muted: #475569;
  --text: #04263a;
  --error: #c81e1e;
  font-family: "Inter", system-ui, sans-serif;
}

/* Page base */
body {
  background: var(--bg);
  margin: 0;
  color: var(--text);
  min-height: 100vh;
  display: grid;
  place-items: center;
}

/* Centered login container */
.auth-card {
  background: #fff;
  padding: 24px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 420px;
  margin: 40px auto;
}

/* Title */
.auth-card h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Form layout */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95rem;
}

input {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 1rem;
  transition: 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.25);
}

/* Buttons */
.actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 6px;
}

.btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.25s;
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn {
  background: #e2e8f0;
  color: #1e293b;
}

.btn:hover {
  background: #cbd5e1;
}

/* Error message */
.error {
  color: var(--error);
  font-size: 0.9rem;
  min-height: 1.2em;
  text-align: center;
  margin-top: 4px;
}

/* Footer link */
.footer-links {
  text-align: center;
  margin-top: 1.2rem;
}

.footer-links .link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links .link:hover {
  color: var(--accent-2);
}

/* Inline links (Forgot Password etc.) */
.inline-links {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
}

.link-btn:hover {
  color: var(--accent-2);
}

/* Note (status text for password reset) */
.note {
  color: #0f766e;
  text-align: center;
  min-height: 1.2em;
  margin-top: 6px;
}

/* Fallback legacy support */
.wrap,
.form-card {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #fff;
  padding: 36px 32px 28px;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

input[type="email"],
input[type="password"],
.form-card input {
  width: 100%;
  box-sizing: border-box;
}

.social {
  display: grid;
  margin-top: 8px;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.02s ease;
}
.btn-google:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.btn-google:active {
  transform: translateY(1px);
}
.btn-google svg {
  display: block;
}

/* === Mobile centering & overflow fix (iOS-friendly) === */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}

/* Prevent any accidental sideways scroll */
html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Use dynamic viewport height on iOS; avoid 100vh jumpiness */
body {
  min-height: 100dvh; /* iOS 16+ */
  background-color: var(--bg, #f0fbff);
}

/* Respect iPhone notch safe areas */
body {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Make primary wrappers truly centered */
.wrap,
.container,
.form-card,
.auth-card {
  margin-left: auto;
  margin-right: auto;
  max-width: 600px; /* tweak if you want wider/narrower */
  width: min(92vw, 600px); /* keeps it nicely centered on small screens */
}

/* Images/SVGs never overflow */
img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* If you used body-centered layouts elsewhere, force blocks instead */
@media (max-width: 768px) {
  /* Remove conflicting body centering if present */
  body {
    display: block !important;
  }
}
