/* Shared styles for the sign-in forms and admin area. Builds on Bootstrap 3
   and assets/css/main.css (Montserrat, #57A5B8 accent). */

:root {
  --accent: #57A5B8;
  --accent-dark: #3f8a9c;
  --ink: #2d3438;
  --muted: #8a949a;
  --line: #e6eaed;
  --surface: #f5f7f8;
  --danger: #d9534f;
  --success: #3c9d6b;
}

/* ---------- Forms ---------- */

.ui-field {
  margin-bottom: 18px;
}

.ui-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.ui-input,
select.ui-input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(87, 165, 184, 0.2);
}

.ui-input.is-invalid {
  border-color: var(--danger);
}

.ui-error {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--danger);
}

.ui-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}

.ui-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.ui-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ui-btn:hover,
.ui-btn:focus {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  text-decoration: none;
}

.ui-btn-block {
  display: flex;
  width: 100%;
}

.ui-btn-ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.ui-btn-ghost:hover,
.ui-btn-ghost:focus {
  color: var(--ink);
  background: var(--surface);
  border-color: #d5dbdf;
}

.ui-btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
}

.ui-btn-danger {
  color: var(--danger);
  background: #fff;
  border-color: #f0c8c7;
}

.ui-btn-danger:hover,
.ui-btn-danger:focus {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

/* ---------- Alerts ---------- */

.ui-alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.ui-alert-success { color: #2b6e4c; background: #eaf6ef; border-color: #cce9d8; }
.ui-alert-info    { color: #2f6575; background: #eaf4f7; border-color: #cfe6ed; }
.ui-alert-danger  { color: #a33a37; background: #fbecec; border-color: #f2cfce; }

/* ---------- Auth pages ---------- */

.auth-page {
  display: flex;
  justify-content: center;
  padding: 60px 16px 90px;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(30, 50, 60, 0.07);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

.auth-card .auth-subtitle {
  margin: 0 0 26px;
  font-size: 14px;
  color: var(--muted);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-row .ui-check {
  margin: 0;
}

.auth-row a {
  font-size: 13px;
}

.auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- Admin ---------- */

.admin-bar {
  margin-bottom: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.admin-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 0;
}

.admin-bar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-nav a {
  display: block;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 7px;
  text-decoration: none;
}

.admin-nav a:hover {
  color: var(--ink);
  background: var(--surface);
}

.admin-nav a.active {
  color: #fff;
  background: var(--accent);
}

.admin-nav .fa {
  margin-right: 5px;
}

.admin-page {
  padding-bottom: 70px;
}

.admin-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-heading h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.admin-heading .count {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.admin-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(30, 50, 60, 0.04);
  overflow: hidden;
}

.admin-card-body {
  padding: 28px;
}

.admin-form {
  max-width: 560px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  margin: 0;
  font-size: 14px;
  border-collapse: collapse;
}

.admin-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.admin-table td {
  padding: 12px 16px;
  color: var(--ink);
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover td {
  background: #fafbfc;
}

.admin-table .muted {
  font-size: 13px;
  color: var(--muted);
}

.admin-table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.admin-table .actions form {
  margin: 0;
}

.admin-thumb {
  width: 72px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-yes  { color: #2b6e4c; background: #eaf6ef; }
.pill-no   { color: #8a949a; background: #f0f2f3; }
.pill-info { color: #2f6575; background: #eaf4f7; }

.admin-pagination {
  margin-top: 20px;
  text-align: center;
}

.admin-pagination .pagination {
  margin: 0;
}

.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.ui-dropzone {
  display: block;
  padding: 34px 20px;
  margin-bottom: 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 2px dashed #d5dbdf;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ui-dropzone:hover {
  border-color: var(--accent);
  background: #eef6f8;
}

.ui-dropzone .fa {
  display: block;
  margin-bottom: 10px;
  font-size: 30px;
  color: var(--accent);
}

.ui-dropzone input[type=file] {
  margin: 12px auto 0;
}

/* ---------- Page bar (album pages) ---------- */

.page-bar {
  margin-bottom: 30px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0;
}

.page-bar-title {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.page-bar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.page-bar h2 a {
  color: inherit;
  text-decoration: none;
}

.page-bar .subtitle {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.page-bar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-bar-actions form {
  margin: 0;
}

.ui-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.ui-icon-btn:hover,
.ui-icon-btn:focus {
  color: var(--ink);
  background: var(--surface);
  border-color: #d5dbdf;
  text-decoration: none;
}

/* ---------- Album filters ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.filter-bar .ui-input {
  width: auto;
  height: 38px;
  padding: 6px 12px;
  font-size: 14px;
}

.filter-search {
  position: relative;
}

.filter-search .fa {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.filter-search .ui-input {
  width: 200px;
  padding-left: 32px;
}

.filter-bar .ui-btn {
  height: 38px;
}

/* ---------- Album tiles ---------- */

.album-tile {
  position: relative;
  display: block;
  margin-bottom: 26px;
  color: var(--ink);
  text-decoration: none;
}

.album-tile:hover,
.album-tile:focus {
  color: var(--ink);
  text-decoration: none;
}

.album-tile .album-cover {
  position: relative;
  padding-bottom: 70%;
  background-color: var(--surface);
  background-position: center;
  background-size: cover;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(30, 50, 60, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.album-tile:hover .album-cover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 50, 60, 0.14);
}

.album-tile .pill {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fff;
  background: var(--accent);
}

.album-tile .album-name {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.album-tile .album-date {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Album photos ---------- */

.album-photos {
  padding-bottom: 20px;
  text-align: center;
}

.album-photos a {
  display: block;
  margin: 0 auto 14px;
}

.album-photos img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* ---------- Album edit grid ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
  padding-bottom: 60px;
}

.photo-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.photo-card.is-cover {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(87, 165, 184, 0.35);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface);
}

.photo-card-actions {
  display: flex;
  gap: 6px;
  padding: 8px;
}

.photo-card-actions form {
  flex: 1;
  margin: 0;
}

.photo-card-actions .ui-btn,
.photo-card-actions .pill {
  width: 100%;
}

.photo-card-actions .pill {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border-radius: 6px;
}

/* ---------- Misc ---------- */

.ui-tag {
  display: inline-block;
  padding: 3px 10px;
  margin: 0 4px 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
}

.project-tile-tags {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ui-card {
  padding: 32px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(30, 50, 60, 0.07);
}

.ui-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* ---------- Pagination (site wide) ---------- */

.pagination {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 30px;
}

.pagination > li > a,
.pagination > li > span {
  display: block;
  float: none;
  min-width: 46px;
  height: 46px;
  padding: 0 16px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 44px;
  text-align: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px !important;
}

.pagination > li > a:hover,
.pagination > li > a:focus {
  color: var(--ink);
  background: var(--surface);
  border-color: #d5dbdf;
}

.pagination > .active > span,
.pagination > .active > span:hover,
.pagination > .active > a,
.pagination > .active > a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.pagination > .disabled > span,
.pagination > .disabled > span:hover {
  color: #c3cacf;
  background: #fff;
  border-color: var(--line);
}

.photo-card-actions form:last-child {
  flex: 0 0 40px;
}

/* ---------- Photo album landing ---------- */

.photo-landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  padding: 60px 16px;
  background-color: var(--surface);
  background-position: center;
  background-size: cover;
}

.photo-landing-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.photo-landing-card h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Error pages ---------- */

.error-page {
  display: flex;
  justify-content: center;
  padding: 70px 16px 100px;
  background: var(--surface);
}

.error-card {
  width: 100%;
  max-width: 460px;
  text-align: center;
}

.error-code {
  margin-bottom: 4px;
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.error-card h1 {
  margin: 10px 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.error-card h1 .fa {
  margin-right: 4px;
  color: var(--muted);
}
