/* EZQR-themed styling for the Kratos self-service UI.
   Palette and typography mirror the EZQR dashboard (teal primary, Nunito Sans). */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;700;900&display=swap');

:root {
  --bg: #f5f4f7;
  --fg: #1a1a1f;
  --muted: #6b6b7b;
  --border: #e5e5e5;
  --border-strong: #cfcfd1;
  --primary: #4f8586;
  --primary-fg: #ffffff;
  --primary-soft: #e6f6f5;
  --error: #a12a2a;
  --success: #1e8e4e;
  --radius: 10px;
  --radius-sm: 5px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}

.layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--fg);
  font-weight: 900;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; }
.brand-name { font-size: 1.35rem; letter-spacing: 0.01em; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 26rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card-wide { max-width: 48rem; }

.card-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 900;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-check { flex-direction: row; align-items: center; }

label { font-weight: 700; font-size: 0.9rem; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  width: 100%;
  background: var(--bg);
}

input:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
  background: #fff;
}

.btn {
  background: var(--primary-soft);
  color: var(--primary);
  border: none;
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease-out, color 0.2s ease-out;
}

.btn:hover { background: var(--primary); color: var(--primary-soft); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Password show/hide toggle, sitting inside the field on the right edge. */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 4rem; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem 0.4rem;
  color: var(--primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.pw-toggle:hover { text-decoration: underline; }

.card-links {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

/* Forces a link (e.g. "Forgot Password") onto its own line within card-links. */
.card-links .link-block { flex-basis: 100%; }

a, .link { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { text-decoration: underline; }

.message {
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  margin: 0.5rem 0;
}
.message-error { background: #ffdfdf; color: var(--error); }
.message-success { background: #e7f6ec; color: var(--success); }
.message-info { background: var(--primary-soft); color: var(--primary); }

.topnav {
  display: flex;
  gap: 1.25rem;
  width: 100%;
  max-width: 48rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Settings page: each method group is its own form, spaced apart. */
.settings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  width: 100%;
}
.settings-heading { width: 100%; max-width: 48rem; margin: 0; font-weight: 900; }
.settings-section { width: 100%; max-width: 48rem; margin: 0; }
.settings-section-title {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.branding { color: var(--muted); font-size: 0.85rem; margin-top: auto; }

.ui-text { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0; }
