/* =============================================
   GLOBAL STYLES
   ============================================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: #F7F5EF;
  color: #2C221B;
  font-family: "Inter", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   PAGE LAYOUT — centres the login card
   ============================================= */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* =============================================
   THE LOGIN CARD
   ============================================= */

.login-frame {
  width: 100%;
  max-width: 384px;
  background-color: #FEFDFA;
  border: 1px solid #DEDAD2;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0px 20px 60px rgba(0, 0, 0, 0.18);
}

/* =============================================
   TOP BAR
   ============================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  border-bottom: 1px solid #DEDAD2;
  background-color: #ECE8DD;
}

.brand {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #3B7569;
  letter-spacing: -0.01em;
}

/* =============================================
   MAIN CONTENT AREA
   ============================================= */

.content {
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.title {
  margin: 0;
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: 1.6rem;
  color: #2C221B;
}

.subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #71675D;
  line-height: 1.5;
}

.course-purpose {
  margin: 10px 0 0;
  padding: 10px 16px;
  background-color: rgba(59, 117, 105, 0.08);
  border-radius: 14px;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #3B7569;
  line-height: 1.4;
}

/* =============================================
   FLASH MESSAGES
   ============================================= */

.message {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid;
  font-size: 0.85rem;
  line-height: 1.5;
  cursor: pointer;
}

.message.hidden {
  display: none;
}

.message ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.message.success {
  background-color: #E4EDE9;
  color: #2C5C51;
  border-color: #BFDACF;
}

.message.error {
  background-color: #FBE9E9;
  color: #A4342A;
  border-color: #F0C6C0;
}

.message.warning {
  background-color: #FBF2E1;
  color: #8A5A1E;
  border-color: #EFDBAE;
}

/* =============================================
   FORM
   ============================================= */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2C221B;
}

input[type="email"],
.password-input {
  width: 100%;
  border: 1px solid #DEDAD2;
  background-color: #FEFDFA;
  color: #2C221B;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}

/* .password-input is styled by class (not [type=password]) because the eye
   toggle below flips this field's type to "text" at runtime - a type
   selector would lose the styling the moment that happens. */
.password-field {
  position: relative;
}

.password-field .password-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #A39A8C;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #3B7569;
}

.password-toggle:focus-visible {
  outline: 2px solid #3B7569;
  outline-offset: 2px;
  border-radius: 8px;
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.password-toggle-icon-hide {
  display: none;
}

.password-toggle.is-active .password-toggle-icon-show {
  display: none;
}

.password-toggle.is-active .password-toggle-icon-hide {
  display: block;
}

input::placeholder {
  color: #A39A8C;
}

input:focus {
  border-color: #3B7569;
  box-shadow: 0 0 0 3px rgba(59, 117, 105, 0.2);
}

/* =============================================
   SMALL LINKS
   ============================================= */

.link-btn {
  background: none;
  border: none;
  color: #3B7569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.link-btn:hover {
  text-decoration: underline;
}

.link-btn.inline {
  font-size: inherit;
}

/* =============================================
   SIGN IN BUTTON
   ============================================= */

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  background-color: #3B7569;
  color: #FAF8F1;
  padding: 13px 16px;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 150ms, transform 150ms;
}

.submit-btn:hover {
  opacity: 0.9;
}

.submit-btn:active {
  transform: scale(0.98);
}

/* =============================================
   BOTTOM TEXT
   ============================================= */

.request-access {
  margin: 0;
  text-align: center;
  font-size: 0.82rem;
  color: #71675D;
}

/* =============================================
   ERROR PAGEs
   ============================================= */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  padding: 12px 0;
}

.error-code {
  font-family: "Nunito", sans-serif;
  font-weight: 900;
  font-size: 3rem;
  color: #3B7569;
  line-height: 1;
}

.error-title {
  margin-top: -6px;
}

.error-desc {
  max-width: 320px;
  line-height: 1.6;
}

.error-desc code {
  background-color: #ECE8DD;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
  word-break: break-all;
}

.error-home-btn {
  margin-top: 6px;
  text-decoration: none;
}