/* Global theme definitions */
:root {
  --navy: #0b2a5b;
  --green: #0a7a3d;
  --red: #b00020;
}

* {
  box-sizing: border-box;
}

body {
  background: #fff;
  color: var(--navy);
}

a {
  color: #1a4fb3;
}

header {
  /* Force header to use a white background regardless of third‑party CSS */
  background: #fff !important;
  color: var(--navy) !important;
  border-bottom: 1px solid #eee;
}

header .brand {
  margin: .6rem 0;
  font-size: 1.6rem;
}

header nav a {
  color: #1a4fb3;
  margin-right: .5rem;
}

/* Ensure navigation buttons (login/signup) share consistent width and alignment */
header nav a.nav-btn {
  min-width: 80px;
  text-align: center;
}

main {
  max-width: 960px;
  margin: auto;
  padding: 1rem;
}

fieldset {
  border: 1px solid #d6e0f5;
  padding: .75rem;
  border-radius: .5rem;
}

legend {
  padding: 0 .4rem;
  font-weight: 600;
}

select {
  min-width: 140px;
  font-size: 1rem;
}

button, .btn { background: var(--navy); color:#fff; border:none; padding:.6rem 1rem; border-radius:.5rem; text-decoration:none; display:inline-block; }

.btn-outline { background: transparent; border:1px solid var(--navy); color: var(--navy); padding:.5rem .8rem; border-radius:.5rem; text-decoration:none; }

.badge-green {
  color: var(--green);
  font-weight: 700;
}

.badge-red {
  color: var(--red);
  font-weight: 700;
}

.footer-copy {
  text-align: center;
  color: #777;
  margin: 1rem 0 .5rem;
  font-size: .9rem;
}

#resultCard {
  background: #fff;
  padding: 1rem;
  border: 1px solid #e8eef9;
  border-radius: .75rem;
}

details > summary {
  cursor: pointer;
  padding: .4rem .6rem;
  border-radius: .5rem;
}

details[open] > summary {
  font-weight: 600;
}

@media (max-width: 768px) {
  main {
    padding: .75rem;
  }
  fieldset {
    padding: .5rem;
  }
  header nav a {
    display: inline-block;
    margin-right: .5rem;
  }
  select {
    width: 100%;
  }
  h2 {
    font-size: 1.35rem;
  }
}

/* Sign-up form customisations */
/* Ensure all inputs, selects and primary buttons in the signup form fill the available width */
#signupForm input[type="text"],
#signupForm input[type="password"],
#signupForm select,
#signupForm button.btn { background: var(--navy); color:#fff; border:none; padding:.6rem 1rem; border-radius:.5rem; text-decoration:none; display:inline-block; }

/* Add a top margin to the primary action button to separate it from preceding fields */
#signupForm button.btn { background: var(--navy); color:#fff; border:none; padding:.6rem 1rem; border-radius:.5rem; text-decoration:none; display:inline-block; }

#signupForm .field-group {
  margin-bottom: 0.75rem;
}

/* Responsive button sizing: ensure consistent button widths on mobile and tablet.
   On screens up to 768px wide (typical mobile), buttons expand to fill
   the container width. On medium screens up to 1024px, enforce a
   reasonable minimum width to prevent buttons shrinking too much. */
@media (max-width: 768px) {
  button,
  .btn,
  .btn-outline { background: transparent; border:1px solid var(--navy); color: var(--navy); padding:.5rem .8rem; border-radius:.5rem; text-decoration:none; }
}

@media (max-width: 1024px) {
  button,
  .btn,
  .btn-outline { background: transparent; border:1px solid var(--navy); color: var(--navy); padding:.5rem .8rem; border-radius:.5rem; text-decoration:none; }
}

/* === Custom patch: requested minimal styling === */

/* 1) Login screen bottom "회원가입" button -> full width, navy background, white text */
main a.btn-outline[href="/signup/"]{
  background: var(--navy) !important;
  color: #fff !important;
  border-color: var(--navy) !important;
  display: block !important;
  width: 100% !important;
}

/* 2) When user is logged in, header "내 시험", "로그아웃" (these anchors have no class) -> navy background, white text */
header nav a:not([class]){
  background: var(--navy) !important;
  color: #fff !important;
  border: 1px solid var(--navy) !important;
  padding: .5rem .8rem;
  border-radius: .5rem;
  text-decoration: none;
}
header nav a:not([class]):hover{ filter: brightness(0.92); }



/* === Minimal patch per request === */

/* 1) 로그인 화면: 로그인 버튼(제출 버튼) 네이비/흰색 */
main form button.btn[type="submit"]{
  background: var(--navy) !important;
  color: #fff !important;
  border-color: var(--navy) !important;
}

/* 2) 사용자 화면: '응시하기' 버튼 네이비/흰색 */
main a.btn[href^="/exam/"]{
  background: var(--navy) !important;
  color:#fff !important;
  border-color: var(--navy) !important;
}
main a.btn[href^="/exam/"]:hover{ filter: brightness(0.92); }



/* Mobile-optimized widths for primary actions */
@media (max-width: 768px) {
  .btn, .btn-outline, a.btn { background: var(--navy); color:#fff; border:none; padding:.6rem 1rem; border-radius:.5rem; text-decoration:none; display:inline-block; }
  table { display: table; width: 100%; }
  th, td { padding: .45rem; }
}

/* Navy variable fallback if not present */
:root { --navy: #0b2a5b; }

/* Attendance/result alt-row styles are handled inline to meet exact color spec. */
