/* =========================
   Sign In Page – Clean CSS
   ========================= */

/* Theme tokens */
:root {
  --brand: #fbbf24;
  --brand-weak: #ffe082;
  --text: #1f2937;
  --muted: #6b7280;
  --error: #e53e3e;
  --line: #e5e7eb;
  --bg: #f8fafc;

  --field-h: 44px;
  --rad-sm: 8px;
  --rad-md: 10px;
  --rad-lg: 14px;
  --pad-x: 14px;
  --icon-w: 32px;
}

/* Base layout: center the card */
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji";
}

/* Ensure no overflow due to padding/border inside the card */
.signInContainer,
.signInContainer * {
  box-sizing: border-box;
}

/* Card */
.signInContainer {
  width: min(520px, 92vw);
  background: #fff;
  border-radius: var(--rad-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 28px 26px 24px;
  overflow: hidden; /* safety */
}

/* Headings */
.signInContainer h1,
.signInContainer h2 {
  margin: 0;
  text-align: center;
}
.signInContainer h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.signInContainer h2 {
  color: var(--muted);
  margin-top: 0.5rem;
  margin-bottom: 1.75rem;
  font-weight: 500;
}

/* Form layout */
#loginForm {
  display: grid;
  gap: 16px;
}
.formGroup {
  display: grid;
  gap: 8px;
  width: 100%;
}
.formGroup label {
  font-weight: 600;
  color: #374151;
}

/* Inputs (email & password – shared styles) */
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  height: var(--field-h);
  padding: 0 var(--pad-x);
  border: 1px solid var(--line);
  border-radius: var(--rad-sm);
  font-size: 1rem;
  background: #fafbfc;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.15);
}

/* Password field with eye icon overlay */
.passwordField {
  position: relative;
  width: 100%;
}
.passwordField input {
  padding-right: calc(var(--pad-x) + var(--icon-w) + 6px); /* space for icon */
}

.passwordField button {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: var(--icon-w);
  height: var(--icon-w);
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
}
.passwordField button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Errors */
.error {
  color: var(--error);
  font-size: 0.92rem;
  min-height: 1.1em;
}
.signInErrorContainer {
  color: var(--error);
  text-align: center;
  min-height: 1.2em;
}

/* Remember + links row */
.signInActionContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.96rem;
}
.signInActionContainer label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.signInActionContainer a {
  color: #c08400;
  text-decoration: none;
}
.signInActionContainer a:hover {
  text-decoration: underline;
}

/* Primary button */
#loginBtn {
  width: 100%;
  height: calc(var(--field-h) + 2px);
  background: var(--brand);
  color: #1f1f1f;
  border: none;
  border-radius: var(--rad-md);
  font-size: 1.06rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}
#loginBtn:hover {
  background: var(--brand-weak);
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.25);
  transform: translateY(-1px);
}
#loginBtn:active {
  transform: translateY(0);
}
#loginBtn:disabled {
  background: #eee;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Sign up link */
.signUpLink {
  text-align: center;
  margin-top: 16px;
  font-size: 0.98rem;
  color: #374151;
}
.signUpLink a {
  color: #c08400;
  text-decoration: none;
  margin-left: 0.35rem;
}
.signUpLink a:hover {
  text-decoration: underline;
}

/* Global focus ring */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

/* Mobile tweaks */
@media (max-width: 420px) {
  .signInContainer {
    padding: 22px 18px 18px;
  }
  #loginForm {
    gap: 14px;
  }
  #loginBtn {
    height: var(--field-h);
  }
}
