/* account.css
   Login and admin pages (Views/Shared/_AccountLayout.cshtml). Same palette
   as the Bible pages: Arial stack, #2c5f8a blue, #f7f5f0 background. */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
}
html {
  /* Phones in landscape otherwise enlarge text on their own. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* No double-tap-to-zoom wait on taps, so buttons respond at once on phones. */
a,
button,
input,
select,
label {
  touch-action: manipulation;
}
body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--color-page-bg);
  color: var(--color-text);
  line-height: 1.5;
  padding: 1.5rem 1rem 3rem;
}
body.centered {
  min-height: 100vh;
  /* The visible height, excluding a phone browser's address bar. */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  background: var(--color-reading-bg);
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  border-radius: 10px;
  padding: 1.75rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.admin-card {
  max-width: 900px;
  margin: 0 auto;
}
.form-card {
  max-width: 480px;
}

h1.title {
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
  letter-spacing: 0.04em;
  color: var(--color-heading);
  text-align: center;
}
.admin-card h1.title {
  text-align: left;
  margin: 0;
}
.form-card h1.title {
  margin-bottom: 1.25rem;
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 1rem;
}
fieldset.field {
  border: 0;
  padding: 0;
}
fieldset.field legend {
  padding: 0;
  margin-bottom: 0.3rem;
}
.field > label,
fieldset.field legend {
  font-weight: bold;
  font-size: 0.95rem;
}
.field input[type="text"],
.field input[type="password"],
.field select {
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--color-text) 30%, transparent);
  border-radius: 6px;
  background: var(--color-reading-bg);
}
.field input:focus,
.field select:focus {
  outline: 2px solid var(--color-menu);
  outline-offset: 1px;
  border-color: var(--color-menu);
}
.field.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.field.checkbox label {
  font-weight: normal;
}
.field.checkbox input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-menu);
}

/* One checkbox per translation on the admin user form. */
.translation-choices .field.checkbox {
  margin: 0;
}

.hint {
  font-size: 0.85rem;
  color: var(--color-muted);
}
.field-error {
  font-size: 0.85rem;
  color: #a33;
}
.field-error:empty {
  display: none;
}
.input-validation-error {
  border-color: #a33 !important;
}
.form-errors ul {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  list-style: none;
  background: #fbeaea;
  border: 1px solid #e3b5b5;
  border-radius: 6px;
  color: #8a2222;
}
.form-errors.validation-summary-valid {
  display: none;
}
.form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: bold;
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--color-text) 30%, transparent);
  background: var(--color-reading-bg);
  color: var(--color-heading);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn:hover,
.btn:focus {
  background: color-mix(in srgb, var(--color-menu) 8%, var(--color-reading-bg));
}
.btn-primary {
  background: var(--color-menu);
  border-color: var(--color-menu);
  color: var(--color-menu-text);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-menu-dark);
}
.btn-danger {
  color: #a33;
}
.btn-danger:hover,
.btn-danger:focus {
  background: #fbeaea;
}
.btn-small {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
}
.btn-block {
  display: block;
  width: 100%;
}
.btn-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--color-heading);
  text-decoration: underline;
}
.btn-link:hover,
.btn-link:focus {
  background: none;
  color: var(--color-menu-dark);
}

/* Admin page */
.admin-header {
  max-width: 900px;
  margin: 0 auto 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
}
.admin-header form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.admin-back {
  color: var(--color-heading);
}
.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.flash {
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  background: color-mix(in srgb, var(--color-menu) 10%, var(--color-reading-bg));
  border: 1px solid color-mix(in srgb, var(--color-menu) 35%, var(--color-reading-bg));
  border-radius: 6px;
  color: var(--color-menu-dark);
}
.table-wrap {
  overflow-x: auto;
}
table.users {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.users th,
table.users td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
  text-align: left;
  white-space: nowrap;
}
table.users th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
}
table.users td.actions {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}
table.users td.actions form {
  margin: 0;
}
.badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  font-size: 0.75rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-menu) 8%, var(--color-reading-bg));
  color: var(--color-heading);
}
.status {
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.status-active {
  background: #e6f2e6;
  color: #2f6b2f;
}
.status-disabled {
  background: #eee;
  color: var(--color-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Phones: everything you tap is at least 40px tall (2.5rem), so it's easy
   to hit with a thumb, and the user list becomes a card per user instead
   of a table you'd have to scroll sideways. */
@media (max-width: 600px) {
  body {
    padding: 0.5rem 0.75rem 2rem;
  }
  .card {
    padding: 1.25rem 1rem;
  }
  .admin-header {
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
  .admin-back,
  .admin-header .btn-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
  }
  .btn {
    min-height: 2.75rem;
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }
  .btn-small {
    min-height: 2.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
  }
  .btn-link {
    padding: 0;
  }
  .form-actions .btn {
    flex: 1;
  }
  .field.checkbox {
    min-height: 2.5rem;
  }
  .field.checkbox input {
    width: 1.35rem;
    height: 1.35rem;
  }
  .field.checkbox label {
    flex: 1;
    padding: 0.5rem 0;
  }

  /* User list: one card per user. Each cell shows its column name from
     data-label, since the table header is hidden. */
  .table-wrap {
    overflow: visible;
  }
  table.users,
  table.users tbody,
  table.users tr,
  table.users td {
    display: block;
  }
  table.users thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  table.users tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  }
  table.users td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.2rem 0;
    border: 0;
    white-space: normal;
  }
  table.users td[data-label]::before {
    content: attr(data-label);
    color: var(--color-muted);
    font-size: 0.85rem;
  }
  table.users td.user-name {
    justify-content: flex-start;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.1rem;
    font-weight: bold;
    padding-bottom: 0.35rem;
  }
  table.users td.actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.6rem;
  }
}

/* Settings page (Views/Settings/Index.cshtml). Everything here uses the
   same CSS variables as the rest of the site, so settings.js can preview
   a change by setting the variable. */
.settings-card {
  max-width: 720px;
}
.settings-section {
  font-size: 1.15rem;
  color: var(--color-heading);
  margin: 1.75rem 0 0.5rem;
}
.size-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.size-row input[type="range"] {
  flex: 1;
  accent-color: var(--color-menu);
}
.size-row output {
  min-width: 3.5rem;
  text-align: right;
  font-weight: bold;
}
.color-list {
  display: flex;
  flex-direction: column;
}
.color-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.color-label {
  display: flex;
  flex-direction: column;
  flex: 1 1 16rem;
}
.color-label label {
  font-weight: bold;
}
.color-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.color-inputs input[type="color"] {
  width: 2.75rem;
  height: 2.25rem;
  padding: 2px;
  border: 1px solid color-mix(in srgb, var(--color-text) 30%, transparent);
  border-radius: 6px;
  background: var(--color-reading-bg);
  cursor: pointer;
}
.color-inputs .hex-input {
  width: 6.5rem;
  font: inherit;
  font-family: Consolas, "Courier New", monospace;
  padding: 0.45rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--color-text) 30%, transparent);
  border-radius: 6px;
  background: var(--color-reading-bg);
  color: var(--color-text);
}
.color-row .field-error {
  flex-basis: 100%;
}
.reset-form {
  margin-top: 1rem;
  text-align: right;
}

/* Preview: a miniature menu bar, book list and reading page. */
.settings-preview {
  margin: 1rem 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  border-radius: 8px;
  overflow: hidden;
}
.preview-menu {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-menu);
  border-bottom: 3px solid var(--color-menu-dark);
}
.preview-menu-item {
  color: var(--color-menu-text);
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--color-menu-text) 12%, transparent);
  display: flex;
  align-items: center;
}
.preview-menu-title {
  flex-direction: column;
  line-height: 1.2;
}
.preview-menu-title small {
  font-size: 0.65rem;
  opacity: 0.85;
}
.preview-page {
  background: var(--color-page-bg);
  padding: 0.75rem;
}
.preview-heading {
  margin: 0 0 0.5rem;
  font-weight: bold;
  color: var(--color-heading);
}
.preview-btn {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
  background: var(--color-menu);
  color: var(--color-menu-text);
}
.preview-btn.is-hover {
  background: var(--color-menu-dark);
}
.preview-muted {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.preview-reading {
  background: var(--color-reading-bg);
  color: var(--color-text);
  padding: 0.75rem;
  line-height: 1.6;
}
.preview-verse {
  margin: 0.2rem 0;
  font-size: calc(1.125rem * var(--verse-scale, 1));
}
.preview-verse .rl {
  color: var(--red-letter, var(--color-red-letter));
}
.preview-number {
  font-weight: bold;
  color: var(--color-verse-number);
  margin-right: 0.4em;
  font-size: 0.85em;
}

/* Settings page on phones: each color's picker, hex box and Default button
   get a full-width row of their own under its label. */
@media (max-width: 600px) {
  .color-inputs {
    flex: 1 1 100%;
  }
  .color-inputs input[type="color"] {
    width: 3rem;
    height: 2.5rem;
  }
  .color-inputs .hex-input {
    flex: 1;
    min-height: 2.5rem;
  }
  .size-row input[type="range"] {
    min-height: 2.5rem;
  }
  .reset-form {
    text-align: center;
  }
  .reset-form .btn-link {
    min-height: 2.75rem;
  }
}
