/*
 * Auth-page styles (login + OAuth2 consent screen), externalized from the former inline <style> in
 * index.jsp (DEV-132). Loaded by /WEB-INF/tags/authLayout.tag. The shared visual base
 * (.loginPage / .leftSection / .rightSection / buttons ...) comes from assets/tmse-main.css.
 */
#tncRow {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 980px;
  height: 86vh;
  max-height: 920px;
  margin: 24px auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .14);
  overflow: hidden;
}
#tncRow .tncHeader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border-bottom: 1px solid #ececec;
  flex: 0 0 auto;
}
#tncRow .tncHeader .fa-file-lines,
#tncRow .tncHeader i { color: #FD656A; font-size: 24px; }
#tncRow .tncTitle .title { font-size: 20px; font-weight: 600; color: #282828; }
#tncRow .tncLangSwitch {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #888;
}
#tncRow .tncLangSwitch .lbl { white-space: nowrap; }
#tncRow .tncLangSwitch a {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  color: #444;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
#tncRow .tncLangSwitch a:hover { border-color: #FD656A; color: #FD656A; background: #fff5f5; }
#tncRow .tnc {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  background: #f4f4f4;
  padding: 20px;
}
#tncRow .tncFrame {
  flex: 1 1 auto;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}
#tncRow .buttonRow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 28px;
  border-top: 1px solid #ececec;
  flex: 0 0 auto;
}
@media (max-width: 768px) {
  #tncRow { margin: 0; border-radius: 0; height: 100vh; max-height: 100vh; max-width: 100%; }
  #tncRow .tncHeader { flex-wrap: wrap; padding: 14px 16px; gap: 10px; }
  #tncRow .tncTitle .title { font-size: 18px; }
  #tncRow .tncLangSwitch { margin-left: 0; width: 100%; }
  #tncRow .tnc { padding: 8px; }
  #tncRow .tncFrame { border-radius: 6px; }
  #tncRow .buttonRow { padding: 12px 16px; }
}

.rightSection.tncSide { align-items: stretch; background: #eef0f3; }
.tncPanel { flex: 1 1 auto; min-height: 0; margin: 22px; display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 14px 46px rgba(20, 25, 40, .12); overflow: hidden; }
.tncPanel .tncHeader { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 24px; border-bottom: 1px solid #f0f0f0; flex: 0 0 auto; }
.tncPanel .tncTitle { justify-self: start; display: flex; align-items: center; }
.tncPanel .tncTitle .title { font-size: 18px; font-weight: 700; color: #1f2330; letter-spacing: .2px; white-space: nowrap; }
.tncPanel .tncBrandIcon { justify-self: center; height: 46px; width: auto; display: block; }
.tncPanel .tncHeaderRight { justify-self: end; display: flex; align-items: center; gap: 12px; }
.tncPanel .tncLangSwitch { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; font-size: 12.5px; color: #9aa0ab; }
.tncPanel .tncLangSwitch .lbl { display: none; }
.tncPanel .tncLangSwitch .lbl { white-space: nowrap; }
.tncPanel .tncLangSwitch a { display: inline-flex; align-items: center; padding: 5px 13px; border: 1px solid #e2e4e9; border-radius: 999px; color: #5b6170; text-decoration: none; font-weight: 600; line-height: 1; transition: all .15s ease; }
.tncPanel .tncLangSwitch a:hover { border-color: #FD656A; color: #FD656A; background: #fff4f4; }
.tncPanel .tncUpdateNotice { display: none; flex: 0 0 auto; margin: 14px 18px 0; padding: 11px 14px; background: #fff6e8; border: 1px solid #f3d9a8; border-left: 3px solid #f0a020; border-radius: 8px; color: #8a5a00; font-size: 13px; line-height: 1.45; }
.tncPanel .tnc { flex: 1 1 auto; min-height: 0; display: flex; background: #f6f7f9; padding: 18px; }
.tncPanel .tncFrame { flex: 1 1 auto; width: 100%; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(20, 25, 40, .05); }
.tncPanel .buttonRow { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 26px; border-top: 1px solid #f0f0f0; flex: 0 0 auto; }
.tncPanel .tncClose { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: #9aa0ab; cursor: pointer; transition: all .15s ease; text-decoration: none; }
.tncPanel .tncClose:hover { background: #f4f4f6; color: #FD656A; }
/* Hamburger menu (mobile only). */
.tncPanel .tncMenu { display: none; position: relative; }
.tncPanel .tncBurger { background: none; border: 1px solid #e2e4e9; border-radius: 8px; width: 38px; height: 38px; font-size: 18px; color: #5b6170; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.tncPanel .tncMenuDrop { display: none; position: absolute; top: calc(100% + 6px); right: 0; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #e6e6e6; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,25,40,.16); padding: 6px; min-width: 132px; z-index: 20; }
.tncPanel .tncMenu.open .tncMenuDrop { display: flex; }
.tncPanel .tncMenuDrop a, .tncPanel .tncMenuDrop .tncMenuClose { display: block; padding: 9px 14px; border-radius: 8px; color: #444; text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.tncPanel .tncMenuDrop a:hover, .tncPanel .tncMenuDrop .tncMenuClose:hover { background: #f6f7f9; color: #FD656A; }
.tncPanel .tncMenuDrop .tncMenuClose { border-top: 1px solid #f0f0f0; margin-top: 4px; color: #e74c3c; }
.tncPanel .tncClose:hover { background: #f4f4f6; color: #FD656A; }
#rightTnc.hidden, #rightLogo.hidden { display: none !important; }
.tncPanel.tncFlash { animation: tncFlash 1.1s ease; }
@keyframes tncFlash { 0%, 100% { box-shadow: 0 14px 46px rgba(20,25,40,.12); } 30% { box-shadow: 0 0 0 3px rgba(253,101,106,.55), 0 14px 46px rgba(20,25,40,.18); } }

.tncAcceptRow { margin-top: 12px; display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 9px; cursor: pointer; padding: 8px 10px; border-radius: 8px; user-select: none; transition: background .15s ease; outline: none; }
.tncAcceptRow:hover { background: #f6f7f9; }
.tncAcceptRow:focus-visible { box-shadow: 0 0 0 2px rgba(253,101,106,.45); }
.tncAcceptRow.accepted { cursor: pointer; }
.tncAcceptRow.accepted:hover { background: #ecfdf3; }
.tncAcceptRow .formError { flex-basis: 100%; width: 100%; margin-top: 2px; }
.tncAcceptRow #tncAcceptBox { display: none; }
.tncAcceptRow .tncEmptyBox { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c8ccd4; background: #fff; flex: 0 0 auto; box-sizing: border-box; transition: border-color .15s ease, background .15s ease; }
.tncAcceptRow:hover .tncEmptyBox { border-color: #FD656A; background: #fff5f5; }
.tncAcceptRow.accepted .tncEmptyBox,
.tncAcceptRow.declined .tncEmptyBox { display: none; }
.tncAcceptRow .tncCheckMark { display: none; width: 20px; height: 20px; border-radius: 50%; background: #2ecc71; color: #fff; align-items: center; justify-content: center; font-size: 10px; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(46,204,113,.4); }
.tncAcceptRow.accepted .tncCheckMark { display: inline-flex; }
.tncAcceptRow .tncCrossMark { display: none; width: 20px; height: 20px; border-radius: 50%; background: #e74c3c; color: #fff; align-items: center; justify-content: center; font-size: 14px; line-height: 1; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(231,76,60,.4); }
.tncAcceptRow.declined .tncCrossMark { display: inline-flex; }
.tncAcceptText { font-size: 13px; color: #5b6170; line-height: 1.45; }
.tncShowLink { color: #FD656A; font-weight: 600; text-decoration: underline; cursor: pointer; }
.tncShowLink:hover { text-decoration: underline; }
#welcomeLoginBtn.disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 1023.98px) {
  .loginPage { display: block !important; background: #fff !important; }
  .loginPage .leftSection, .loginPage .rightSection { flex-basis: 100% !important; width: 100% !important; }
  .rightSection.tncSide { min-height: 90vh; }
  .tncPanel { margin: 10px; border-radius: 14px; min-height: 88vh; }
  .tncPanel .tncHeader { padding: 10px 12px; gap: 14px; }
  .tncPanel .tncBrandIcon { height: 30px; margin: 0 6px; }
  .tncPanel .tncTitle .title { font-size: 15px; }
  .tncPanel .tncLangSwitch, .tncPanel .tncClose { display: none; }
  .tncPanel .tncMenu { display: block; }
}

/*
 * OAuth2 consent screen (body.oauthConsentPage). Vertically center the short form like the login /
 * password-change card, and lay the scope checkbox on the same line as its label text.
 */
.oauthConsentPage .leftSection { justify-content: center; padding-top: 3rem; padding-bottom: 3rem; }
.oauthConsentPage .oauthConsentContainer .sectionSubTitle { margin-bottom: 28px; }
.oauthConsentPage .oauthScope { width: 100%; }
.oauthConsentPage .oauthScopeLabel {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.45;
  color: #444;
}
.oauthConsentPage .oauthScopeLabel input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #FD656A;
}
.oauthConsentPage .oauthScopeLabel span { flex: 1 1 auto; }
.oauthConsentPage .buttonRow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
