/* Portal management UI — layered on top of styles.css */

/* ── Year-group crest icons (examples page) ──────────────────────────────── */
.exampleYearGroup > div > svg {
  width: 100%;
  height: 100%;
}

/* ── Nav login button ────────────────────────────────────────────────────── */
.nav-login-btn {
  padding: 6px 18px;
  border: 1px solid var(--light-yellow);
  border-radius: 5px;
  color: var(--light-yellow) !important;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.nav-login-btn:hover {
  background: var(--light-yellow);
  color: var(--wine) !important;
}

/* ── Login page ─────────────────────────────────────────────────────────── */
body.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(73, 17, 36, 0.15);
  padding: 40px;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  height: 56px;
}

.login-card h1 {
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--wine);
  text-align: center;
  margin-bottom: 24px !important;
}

/* ── Portal pages ────────────────────────────────────────────────────────── */
.portal-page {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.portal-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(73, 17, 36, 0.1);
  padding: 36px 40px;
  width: 100%;
  max-width: 700px;
}

.portal-card--wide {
  max-width: 1000px;
}

.portal-title {
  font-size: 1.6rem !important;
  font-weight: 500;
  color: var(--wine);
  margin-bottom: 24px !important;
}

.portal-subtitle {
  font-size: 1.1rem !important;
  font-weight: 500;
  color: var(--dark-wine);
  margin: 20px 0 12px !important;
}

.portal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.portal-title-row .portal-title {
  margin-bottom: 0 !important;
}

.portal-hint {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.portal-divider {
  border: none;
  border-top: 1px solid var(--grey);
  margin: 28px 0;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.alert-error {
  background: #fdecea;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ── Forms ───────────────────────────────────────────────────────────────── */
.portal-form .form-group,
.login-card .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.portal-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .portal-form .form-row {
    grid-template-columns: 1fr;
  }
  .portal-card {
    padding: 24px 20px;
  }
}

label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--dark-blue);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
.input-inline {
  padding: 10px 12px;
  border: 1px solid var(--grey);
  border-radius: 6px;
  font-family: Ubuntu, sans-serif;
  font-size: 1rem;
  color: var(--dark-blue);
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--light-wine);
}

.form-group--check {
  justify-content: flex-end;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  font-family: Ubuntu, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn:hover {
  opacity: 0.85;
}

.btn-primary {
  background: var(--wine);
  color: var(--light-yellow);
}

.btn-secondary {
  background: var(--grey);
  color: var(--dark-blue);
}

.btn-danger {
  background: #b71c1c;
  color: #fff;
}

.btn-full {
  width: 100%;
  text-align: center;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.portal-table th {
  background: var(--dark-wine);
  color: var(--light-yellow);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
}

.portal-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--grey);
  vertical-align: middle;
}

.portal-table tr:last-child td {
  border-bottom: none;
}

.portal-table tr.row-inactive td {
  opacity: 0.5;
}

.status-active  { color: #2e7d32; font-weight: 500; }
.status-inactive { color: #b71c1c; font-weight: 500; }

.role-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.role-administrator { background: #fce4ec; color: #880e4f; }
.role-account_owner { background: #e3f2fd; color: #0d47a1; }
.role-account_user  { background: #e8f5e9; color: #1b5e20; }

/* ── Inline form (org rename) ────────────────────────────────────────────── */
.inline-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-form .input-inline {
  width: auto;
  flex: 1;
  min-width: 0;
}

.portal-form--inline {
  max-width: 400px;
}
