/* ─── Login & Create-User shared form styles ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:    #4f6ef7;
  --accent-dk: #3a56d4;
  --surface:   #ffffff;
  --bg:        #f0f2f8;
  --border:    #dde1f0;
  --text:      #1e2235;
  --muted:     #6b7494;
  --danger:    #e5534b;
  --radius:    12px;
  --font:      'Inter', 'Roboto', system-ui, sans-serif;
}

/* ─── Dark mode ─────────────────────────────────────────────────────── */
html.dark {
  --accent:    #7b96ff;
  --accent-dk: #9eaeff;
  --surface:   #1e2235;
  --bg:        #13151f;
  --border:    #2e3350;
  --text:      #e4e7f5;
  --muted:     #8890b0;
  --danger:    #f07070;
}

@media (prefers-color-scheme: dark) {
  :root:not(.dark):not(.light) {
    --accent:    #7b96ff;
    --accent-dk: #9eaeff;
    --surface:   #1e2235;
    --bg:        #13151f;
    --border:    #2e3350;
    --text:      #e4e7f5;
    --muted:     #8890b0;
    --danger:    #f07070;
  }
}

html { transition: background-color .2s, color .2s; }
*, *::before, *::after { transition: background-color .2s, border-color .2s, color .2s; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* safe areas for notched devices */
  padding: max(1.5rem, env(safe-area-inset-top))
           max(1.5rem, env(safe-area-inset-right))
           max(1.5rem, env(safe-area-inset-bottom))
           max(1.5rem, env(safe-area-inset-left));
}

/* ─── Theme toggle button ───────────────────────────────────────────── */
.theme-btn {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, transform .08s;
  z-index: 100;
  padding: 0;
  line-height: 1;
}
.theme-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: scale(1.05);
}
.theme-btn:active {
  transform: scale(.95);
}

/* ─── Language toggle button ────────────────────────────────────────── */
.lang-btn {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(4.5rem, calc(env(safe-area-inset-right) + 3.5rem));
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, transform .08s;
  z-index: 100;
  line-height: 1;
}
.lang-btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: scale(1.05);
}
.lang-btn:active {
  transform: scale(.95);
}

/* ─── Utility classes ────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ─── Auth card ─────────────────────────────────────────────────────── */
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(30,34,53,.12);
  width: 100%;
  max-width: 400px;
  padding: 2.4rem 2rem 2rem;
}

.auth-card .brand {
  text-align: center;
  margin-bottom: 1.8rem;
}

.auth-card .brand img {
  max-height: 48px;
}

.auth-card .brand h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .6rem;
}

.auth-card .brand p {
  font-size: .88rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* ─── Alert ─────────────────────────────────────────────────────────── */
.alert {
  padding: .65rem 1rem;
  border-radius: 7px;
  font-size: .88rem;
  margin-bottom: 1.1rem;
}
.alert-danger {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}
.alert.hidden {
  display: none;
}

/* ─── Form elements ─────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.1rem;
}

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}

input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  padding: .62rem .9rem;
  /* 16px minimum prevents iOS auto-zoom on focus */
  font-size: max(.95rem, 16px);
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  height: auto;
  margin: 0;
}
input[type="text"]:focus,
input[type="password"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,.15);
  background: var(--surface);
}
input[type="text"].is-invalid,
input[type="password"].is-invalid {
  border-color: var(--danger);
}
.invalid-feedback {
  display: block;
  font-size: .8rem;
  color: var(--danger);
  margin-top: .3rem;
}

/* ─── Submit / Reset buttons ────────────────────────────────────────── */
.btn-submit,
input[type="submit"].btn-primary {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  text-align: center;
  padding: .72rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .08s;
  margin-top: .4rem;
}
.btn-submit:hover,
input[type="submit"].btn-primary:hover {
  background: var(--accent-dk);
  box-shadow: 0 4px 14px rgba(79,110,247,.3);
}
.btn-submit:active { transform: scale(.98); }

.btn-secondary {
  all: unset;
  display: inline-block;
  padding: .5rem 1.1rem;
  font-size: .88rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .14s, color .14s;
  margin-top: .4rem;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.form-footer {
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 1.3rem;
}
.form-footer a { color: var(--accent); }
.form-footer a:hover { color: var(--accent-dk); }

/* ─── Responsive ────────────────────────────────────────────────────── */

/* small phones */
@media (max-width: 440px) {
  .auth-card { padding: 1.8rem 1.2rem 1.6rem; }
}

/* very small phones (320 px – Galaxy Fold, etc.) */
@media (max-width: 360px) {
  .auth-card {
    padding: 1.4rem .95rem 1.3rem;
    border-radius: 10px;
  }
  .auth-card .brand h2 { font-size: 1.25rem; }
}

/* landscape phones — make card wider but not full-screen tall */
@media (max-height: 500px) and (orientation: landscape) {
  body { align-items: flex-start; }
  .auth-card { margin: .75rem auto; }
}

.social i{
	margin-right: 4px;
}
/* ─── 404 error page ─────────────────────────────────────────────────── */
.error-code {
  font-size: 5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}
