/*
 * Native MyAAC output inside the page parchment (.aac). Pages that are not overridden still
 * render the classic markup (tables with bgcolor, Tibia.com box frames, plain forms); this layer
 * gives that markup the same parchment, table and form look as the rest of the site.
 */
.aac { padding: 8px 24px 4px; color: var(--ink); font-size: 15px; }
.aac p { margin: 0 0 12px; }
.aac h2, .aac h3 { margin: 18px 0 10px; color: var(--ink-strong); }
.aac h2 { font-size: 22px; }
.aac h3 { font-size: 18px; }
.aac img { max-width: 100%; }
.aac a { font-weight: 800; }
.aac hr { border: 0; border-top: 1px solid #b08a5566; margin: 16px 0; }

/* tables.headline blocks */
.aac-block + .aac-block { margin-top: 18px; }
.aac-block > .ph { padding-top: 6px; }
.aac-block-b { padding: 4px 0 0; }

/* classic tables: drop the inline colours, keep the structure (site tables use .tt) */
.aac table:not(.tt) { width: 100%; border-collapse: collapse; border: 0; }
.aac table:not(.tt) table { margin: 0; }
.aac table:not(.tt) tr, .aac table:not(.tt) td, .aac table:not(.tt) th { background: none; }
.aac table:not(.tt) td, .aac table:not(.tt) th { padding: 6px 10px; border-bottom: 1px solid #b08a5544; color: var(--ink); text-align: left; vertical-align: middle; }
.aac table:not(.tt) tr:nth-child(even) > td { background: #d9b97a33; }
.aac table:not(.tt) td.white, .aac table:not(.tt) .LabelH td, .aac table:not(.tt) tr.LabelH > td, .aac table:not(.tt) thead td {
  background: var(--window) var(--tex-stone) 0 0 / 96px 96px; background-blend-mode: soft-light;
  color: #fff; font: 700 12.5px var(--font-game); text-shadow: var(--outline); border-bottom: 2px solid var(--night);
}
.aac td.white a, .aac .LabelH a { color: var(--gold-light); }
.aac .LabelV, .aac .LabelV150, .aac .LabelV200 { width: 180px; font-weight: 900; color: var(--ink-strong); }
.aac .white { color: #fff; }

/* Tibia.com frames used by account pages and messages: keep content, drop the artwork */
.aac .TableContainer, .aac .SmallBox { margin: 0 0 18px; }
.aac .CaptionContainer .Text { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 0 8px; font: 900 16px var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--link); }
.aac .CaptionContainer .Text::before, .aac .CaptionContainer .Text::after { content: ''; width: 8px; height: 8px; background: #e8901f; transform: rotate(45deg); }
.aac [class^="Caption"]:not(.CaptionContainer):not(.CaptionInnerContainer), .aac [class^="BoxFrame"], .aac [class^="TableShadow"], .aac [class^="TableBottom"], .aac .AttentionSign { display: none; }
.aac .Table1, .aac .Table2, .aac .Table3, .aac .Table4, .aac .Table5 { background: none !important; }
.aac .InnerTableContainer { padding: 0; }
.aac .TableContent { width: 100%; }
.aac .Message, .aac .ErrorMessage { padding: 12px 14px; border: 2px solid #e8b33a; border-radius: 4px; background: #fff6d6; color: var(--ink-strong); }
.aac .ErrorMessage { border-color: #c0392b; background: #ffe6e0; }
.aac .ErrorMessage li { margin-left: 18px; }

/* forms */
.aac input[type=text], .aac input[type=password], .aac input[type=email], .aac input[type=number], .aac input[type=search], .aac select, .aac textarea {
  max-width: 100%; min-height: 40px; padding: 7px 11px; border: 2px solid; border-color: #8a6a3a #f6e7c2 #f6e7c2 #8a6a3a; border-radius: 3px;
  background: #fff8e6; color: #1a2333; font: 700 15px var(--font-body);
}
.aac input:focus, .aac select:focus, .aac textarea:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px #1d4f9c33; }
.aac input[type=checkbox], .aac input[type=radio] { accent-color: var(--link); }
.aac label { color: var(--ink-strong); font-weight: 800; }
.aac input[type=submit], .aac button:not(.tab):not(.chip):not(.btn) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 2px solid; border-radius: 4px;
  border-color: #fff4c4 #b97b0c #b97b0c #fff4c4; background: linear-gradient(#ffe08a, #ffc847 50%, #f0a51c); color: #3a2400;
  font: 900 15px var(--font-body); box-shadow: 0 0 0 2px var(--night); cursor: pointer;
}
.aac input[type=submit]:hover, .aac button:not(.tab):not(.chip):not(.btn):hover { filter: brightness(1.08); }
.aac .BigButton { display: inline-block; }
.aac .BigButton > div { display: contents; }
.aac .BigButtonOver { display: none; }

/* admin links shown to staff */
.aac .admin-links, .aac a[href*="admin/"] { font-size: 12.5px; }

@media (max-width: 640px) {
  .aac { padding: 8px 12px 4px; }
  .aac table:not(.tt) { display: block; overflow-x: auto; }
}
.aac h2.ph { margin: 0; font-size: 17px; color: var(--link); }

/* Tibia.com table shadows are set as inline background images; on parchment they show as stripes */
.aac .TableContentAndRightShadow, .aac .TableContentContainer, .aac .TableShadowContainer { background-image: none !important; }
.aac .TableContent { border: 0 !important; }
/* .aac already pads 24px; components that carry their own side padding should not add it again */
.aac .twrap, .aac .note { margin-left: 0; margin-right: 0; }
.aac .kv, .aac .pb, .aac .tabs, .aac .chips, .aac .actions, .aac .pform, .aac .glist { padding-left: 0; padding-right: 0; }

/* ---- native forms (account, guild and character pages) ---- */
/* Tibia.com table frames become one parchment card per block */
.aac .TableContainer { margin: 0 0 18px; padding: 2px 16px 12px; background: #fff8e6aa; border: 1px solid #b08a5566; border-radius: 4px; box-shadow: 0 1px 0 #fff8 inset; }
.aac .TableContainer > table, .aac .InnerTableContainer > table { width: 100%; }
.aac .TableContent { width: 100%; }
.aac .TableContent tr > td, .aac .TableContent tr:nth-child(even) > td { background: none; border-bottom: 1px dashed #b08a5566; padding: 9px 8px; }
.aac .TableContent tr:last-child > td { border-bottom: 0; }
.aac .TableContent .LabelV, .aac .TableContent .LabelV150, .aac .TableContent .LabelV200 {
  width: 170px; font: 800 12px var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); vertical-align: top; padding-top: 14px;
}
.aac .TableContent input[type=text], .aac .TableContent input[type=password], .aac .TableContent input[type=email],
.aac .TableContent select, .aac .TableContent textarea { width: 100% !important; max-width: 460px; }
.aac textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.aac .FormFieldError { color: #9a3b2a; font-weight: 800; font-size: 13px; }

/* rows that only hold buttons (Submit / Back, Change Password / Change Email ...) line up centred */
.aac table:has(.btn):not(:has(input:not([type=hidden]), textarea, select, .TableContent, a:not(.btn))),
.aac table:has(.btn):not(:has(input:not([type=hidden]), textarea, select, .TableContent, a:not(.btn))) > tbody,
.aac table:has(.btn):not(:has(input:not([type=hidden]), textarea, select, .TableContent, a:not(.btn))) > tbody > tr {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; width: 100%;
}
.aac table:has(.btn):not(:has(input:not([type=hidden]), textarea, select, .TableContent, a:not(.btn))) > tbody > tr > td {
  display: block; width: auto !important; padding: 0; border: 0; background: none;
}
.aac table:has(.btn):not(:has(input:not([type=hidden]), textarea, select, .TableContent, a:not(.btn))) > tbody > tr > td:empty { display: none; }
.aac form { margin: 0; }
.aac .InnerTableButtonRow { width: 100%; margin-top: 12px; }
.aac .TopButtonContainer { display: none; }
.aac .TableContainer table tr > td, .aac .TableContainer table tr:nth-child(even) > td { background: none; }
.aac .TableContainer .TableContent tr > td { border-bottom: 1px dashed #b08a5566; }
.aac .TableContainer table .LabelH td, .aac .TableContainer table tr.LabelH > td, .aac .TableContainer table thead td {
  background: var(--window) var(--tex-stone) 0 0 / 96px 96px; background-blend-mode: soft-light;
}
