/* Colours, fonts and component styles follow keycloak.bilkent.edu.tr (all assets served locally) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Inter-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/Inter-Bold.woff2") format("woff2");
}

:root {
  --blue: #004996;
  --header-from: #004d9e;
  --header-to: #002f62;
  --link: #1f63b3;
  --text: #4d5d70;
  --text-strong: #09192a;
  --input-border: #cfe8fd;
  --footer-text: #a4b6c9;
  --radius: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #efefef;
}

a { color: var(--link); font-weight: 700; }

code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--text-strong);
  background: #eef4fb;
  padding: .1em .4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

/* Header & footer */
.header, .footer { background: linear-gradient(to right, var(--header-from), var(--header-to)); }
.header {
  min-height: 80px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 20px;
  text-decoration: none;
}
.header-brand span { font-weight: 700; line-height: 1.25; }
.header-brand small {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, .9);
}
.header-user { display: flex; align-items: center; gap: 12px; margin: 0; color: #fff; font-size: 14px; }
.header-user button {
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
}
.header-user button:hover { background: rgba(255, 255, 255, .22); }

.footer {
  padding: 8px 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--footer-text);
  font-size: 12px;
  font-weight: 700;
}
.footer a { color: var(--footer-text); }
.footer-divider { width: 1px; height: 20px; background: var(--footer-text); }

/* Layout */
.main { flex: 1; background: linear-gradient(#efefef, #dce5f2); }
.container { max-width: 1040px; margin: 0 auto; padding: 32px 16px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 24px;
  align-items: start;
}
.grid + .card { margin-top: 24px; }

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .1);
  padding: 32px;
}
.card.narrow { max-width: 580px; margin: 0 auto; }
.card h1, .card h2 { color: var(--blue); font-size: 24px; line-height: 1.3; margin: 0 0 16px; }
.card p { margin: 0 0 16px; }
.card ul { padding-left: 1.2rem; margin: 0 0 16px; }
.card li { margin: 4px 0; }
.hint { font-size: 14px; margin: 8px 0 0 !important; }

/* Forms */
form { margin: 0; }
.form-group { margin-bottom: 20px; }
label { display: block; font-size: 18px; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--text-strong);
  padding: 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  background: #fff;
}
input::placeholder { color: #9aabbd; font-style: italic; }
input:focus { outline: none; border: 2px solid var(--text-strong); padding: 11px; }
.password-field { display: flex; gap: 8px; }
.password-field input { flex: 1; min-width: 0; }
.password-field button, .secret button {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--link);
  background: #eef4fb;
  border: 0;
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
}
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; font-weight: 400; margin: 0; }
.checkbox input { margin-top: 5px; }
.delete-form { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.delete-form .checkbox { flex: 1 1 320px; }

.button {
  display: block;
  width: 100%;
  padding: 12px 24px;
  text-align: center;
  font: inherit;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(to right, #87beff, var(--blue));
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button-danger { width: auto; background: linear-gradient(to right, #f19a9a, #b42318); }
.danger h2 { color: #b42318; }
:focus-visible { outline: 3px solid rgba(31, 99, 179, .45); outline-offset: 2px; }

/* Details */
.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; }
.details dd { margin: 0; color: var(--text-strong); min-width: 0; }
.secret { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.secret code { font-size: 18px; letter-spacing: .05em; }
.secret button { padding: 6px 12px; }

/* Alerts */
/* Same as .bk-alert-* on keycloak.bilkent.edu.tr */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid;
  border-radius: 8px;
  font-size: 14px;
  line-height: 20px;
}
.alert-icon { flex-shrink: 0; align-self: flex-start; }
.alert-info { color: #004996; background: #eaf4ff; border-color: #87beff; }
.alert-warning { color: #956d00; background: #fff7e0; border-color: #d49b00; }
.alert-warning .alert-icon { color: #d49b00; }
.alert-error { color: #ba000b; background: #fcebec; border-color: #ba000b; }
.alert-success { color: #009676; background: #e5fff8; border-color: #009676; }

@media (max-width: 600px) {
  .container { padding: 16px 12px; }
  .card { padding: 24px 20px; }
  .header-user span { display: none; }
  .footer { justify-content: center; text-align: center; }
  .footer-divider { display: none; }
  .button-danger { width: 100%; }
  .details { grid-template-columns: 1fr; gap: 2px; }
  .details dd { margin-bottom: 8px; }
}
