/* ===================================================================== */
/* Login screen (#auth): the CoreCraftia fantasy frame - bright blue      */
/* borders, wooden sign titles and leaf corners - matching the in-game     */
/* windows. Presentation only; markup, ids and behaviour are untouched.    */
/* Loaded after corecraftia-ui.css / windows.css, so it uses "body #auth"  */
/* (and !important where those sheets do).                                 */
/* ===================================================================== */

body #auth{
  --au-frame: #2f93ff;
  --au-wood: linear-gradient(180deg, #d79a58 0%, #b87438 52%, #8d5226 100%);
  --au-wood-grain: repeating-linear-gradient(92deg, rgba(60, 28, 6, 0) 0 22px, rgba(60, 28, 6, 0.16) 22px 24px);
  --au-leaf-tl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%200%29%20scale%281%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --au-leaf-tr: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%200%29%20scale%28-1%201%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --au-leaf-bl: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%280%2070%29%20scale%281%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  --au-leaf-br: url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2090%2070%27%3E%3Cg%20transform=%27translate%2890%2070%29%20scale%28-1%20-1%29%27%3E%3Cdefs%3E%3ClinearGradient%20id=%27g%27%20x1=%270%27%20y1=%270%27%20x2=%271%27%20y2=%271%27%3E%3Cstop%20offset=%270%27%20stop-color=%27%23a6e864%27/%3E%3Cstop%20offset=%271%27%20stop-color=%27%232f8a3a%27/%3E%3C/linearGradient%3E%3Cg%20id=%27l%27%3E%3Cpath%20d=%27M2%2012C10%200%2028%200%2038%2012%2028%2024%2010%2024%202%2012Z%27%20fill=%27url%28%23g%29%27%20stroke=%27%2316501f%27%20stroke-width=%272%27%20stroke-linejoin=%27round%27/%3E%3Cpath%20d=%27M6%2012H34%27%20stroke=%27%23d8f8ad%27%20stroke-opacity=%27.75%27%20stroke-width=%271.6%27%20stroke-linecap=%27round%27/%3E%3C/g%3E%3C/defs%3E%3Cuse%20href=%27%23l%27%20x=%272%27%20y=%2726%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-38%2019%2036%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2722%27%20y=%278%27%20width=%2734%27%20height=%2720%27%20transform=%27rotate%28-8%2039%2018%29%27/%3E%3Cuse%20href=%27%23l%27%20x=%2740%27%20y=%2734%27%20width=%2730%27%20height=%2718%27%20transform=%27rotate%2834%2055%2043%29%27/%3E%3C/g%3E%3C/svg%3E");
  font-family: Georgia, "Times New Roman", serif;
}

/* ---- room for the signs / leaves that overhang the frames ---- */
body #auth .auth-shell{ padding-top: clamp(26px, 4vh, 40px); align-items: start; }

/* ---- the three framed panels ---- */
body #auth .auth-hero,
body #auth .auth-card,
body #auth .auth-event-card,
body #auth .auth-connect-card{
  position: relative;
  overflow: visible !important;
  border: 4px solid var(--au-frame) !important;
  border-radius: 22px !important;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 170, 255, 0.22), transparent 60%),
    linear-gradient(180deg, #123c72 0%, #0b2750 52%, #081b38 100%) !important;
  box-shadow:
    0 0 0 2px #082f66,
    0 18px 40px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(150, 210, 255, 0.35),
    inset 0 3px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
body #auth .auth-hero::before,
body #auth .auth-card::before{ display: none !important; }

/* leaf corners (one overlay per frame, four corner images) */
body #auth .auth-hero::after,
body #auth .auth-card::after,
body #auth .auth-event-card::after,
body #auth .auth-connect-card::after{
  content: "";
  position: absolute;
  inset: -16px;
  z-index: 6; /* above the wooden signs (5) */
  width: auto;
  height: auto;
  opacity: 1 !important;
  display: block !important;
  pointer-events: none;
  border-radius: 0;
  background:
    var(--au-leaf-tl) left top / 58px 45px no-repeat,
    var(--au-leaf-tr) right top / 58px 45px no-repeat,
    var(--au-leaf-bl) left bottom / 58px 45px no-repeat,
    var(--au-leaf-br) right bottom / 58px 45px no-repeat !important;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

/* ---- wooden sign titles ---- */
body #auth .auth-hero-headline,
body #auth .auth-card::before,
body #auth .auth-connect-title{
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -52%);
  z-index: 5;
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 7px 26px 9px;
  border: 3px solid #4a2a10;
  border-radius: 10px;
  background: var(--au-wood-grain), var(--au-wood) !important;
  box-shadow: 0 4px 0 #2a1507, inset 0 3px 0 rgba(255, 233, 190, 0.45), inset 0 -4px 0 rgba(60, 28, 6, 0.35);
  color: #fff;
  font: 900 clamp(14px, 1.45vw, 21px)/1.05 Georgia, "Times New Roman", serif;
  letter-spacing: 0.03em;
  text-align: center;
  text-transform: none;
  -webkit-text-stroke: 4px #0a1c3c;
  paint-order: stroke fill;
  text-shadow: 0 3px 0 rgba(6, 14, 34, 0.85);
  white-space: nowrap;
  margin: 0;
}
body #auth .auth-hero-headline{ text-transform: uppercase; letter-spacing: 0.02em; }
body #auth .auth-card::before{
  display: block !important;
  content: "Login to CoreCraftia";
  right: auto;
  bottom: auto;
  opacity: 1;
  pointer-events: none;
}
body #auth .auth-card[data-auth-mode="register"]::before{ content: "Join CoreCraftia"; }
body #auth .auth-connect-title::before{ content: "JOIN OUR COMMUNITY"; }
body #auth .auth-connect-title{ font-size: clamp(12px, 1.15vw, 17px); }
/* the copy block holds the sign and is its own layer (z 1 in corecraftia-ui.css, same as the feature grid that comes
   after it), so the first feature card used to paint over the sign; one layer up keeps the sign on top */
body #auth .auth-hero-copy{ margin-top: clamp(16px, 2.4vh, 26px); margin-bottom: 4px; z-index: 2; }

/* extra top space inside frames that carry a sign */
body #auth .auth-hero{ padding-top: clamp(26px, 3.4vh, 36px); }
body #auth .auth-card{ padding-top: clamp(30px, 4vh, 40px); }
body #auth .auth-connect-card{ padding: clamp(32px, 4.6vh, 46px) 12px 12px !important; }

/* ---- hero feature cards ---- */
body #auth .auth-feature-card{
  border: 2px solid rgba(120, 190, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(4, 14, 32, 0.72), rgba(6, 20, 42, 0.58));
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.35);
}
body #auth .auth-feature-title{ color: #fff; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
body #auth .auth-feature-copy{ color: rgba(207, 233, 255, 0.9); }
body #auth .auth-feature-icon{ border: 2px solid rgba(120, 190, 255, 0.55); border-radius: 12px; }

/* ---- login form ---- */
body #auth .auth-label{
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #cfe9ff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}
body #auth .auth-field{
  border: 3px solid #4aa8ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #06193a, #0a2347);
  box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.6);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
body #auth .auth-field:focus-within{
  border-color: #8fd2ff;
  box-shadow: 0 0 10px rgba(80, 170, 255, 0.6), inset 0 3px 7px rgba(0, 0, 0, 0.6);
}
body #auth .auth-field input{ color: #f4fbff; font-family: Georgia, serif; font-weight: 700; }
body #auth .auth-field input::placeholder{ color: rgba(190, 226, 245, 0.55); }

/* custom blue checkbox */
body #auth .auth-remember-row{ font-weight: 800; color: #fff; }
body #auth .auth-remember-row input{
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 3px solid #4aa8ff;
  border-radius: 6px;
  background: linear-gradient(180deg, #06193a, #0a2347);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
body #auth .auth-remember-row input:checked{
  border-color: #cfe9ff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7' fill='none' stroke='white' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat,
    linear-gradient(180deg, #5ab4ff 0%, #2677e6 50%, #1757bd 100%);
}
body #auth .auth-remember-row input:focus-visible{ outline: 2px solid #ffe27a; outline-offset: 2px; }
body #auth .auth-link-secondary,
body #auth .auth-link{ color: #5fd3ff; font-weight: 900; }
body #auth .auth-foot-copy{ color: #e7f4ff; font-weight: 700; }

/* 3D buttons */
body #auth .auth-btn{
  position: relative;
  overflow: hidden;
  min-height: clamp(44px, 4.6vw, 54px);
  border: 3px solid #0b2c5e !important;
  border-radius: 15px;
  font: 900 clamp(15px, 1.3vw, 18px)/1.05 Georgia, serif;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 20, 60, 0.85);
  background: linear-gradient(180deg, #4aa6ff 0%, #2677e6 50%, #1757bd 100%) !important;
  box-shadow: 0 0 0 2px #061a38, 0 5px 0 2px #061a38, inset 0 3px 0 rgba(255, 255, 255, 0.45) !important;
  transition: transform 120ms ease, filter 120ms ease;
}
body #auth .auth-btn::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}
body #auth #register{
  border-color: #0b4a1a !important;
  background: linear-gradient(180deg, #7dff6a 0%, #2fd13f 48%, #139a28 100%) !important;
  box-shadow: 0 0 0 2px #062a10, 0 5px 0 2px #062a10, inset 0 3px 0 rgba(255, 255, 255, 0.5) !important;
  text-shadow: 0 2px 0 rgba(0, 60, 10, 0.85);
}
body #auth .auth-btn:hover{ filter: brightness(1.1); transform: translateY(-2px); }
body #auth .auth-btn:active{ filter: brightness(0.94); transform: translateY(2px) scale(0.985); }
body #auth .auth-btn:focus-visible{ outline: 3px solid #ffe27a; outline-offset: 3px; }
body #auth .auth-actions{ margin-top: 10px; margin-bottom: 4px; }
body #auth .auth-msg{ color: #ffb4a8; font-weight: 800; }

/* skin swatches keep their colours; only the frame is aligned */
body #auth .auth-skin-btn{ border: 2px solid rgba(143, 210, 255, 0.55); }
body #auth .auth-skin-btn.is-active{ border-color: #ffd34a; box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 0 0 2px rgba(255, 211, 74, 0.55), 0 8px 16px rgba(0,0,0,0.32); }

/* ---- right rail ---- */
body #auth .auth-rail-card{ padding: 0; }
body #auth .auth-event-card{
  padding: 0 !important;
  overflow: hidden !important;
  border: 4px solid var(--au-frame) !important;
  background: #081b38 !important;
}
body #auth .auth-event-card::after{ inset: -16px; }
body #auth .auth-event-image{ display: block; width: 100%; height: auto; min-height: 0; object-fit: contain; border-radius: 14px; }
body #auth .auth-connect-btn{ transition: transform 120ms ease, filter 120ms ease; }
body #auth .auth-connect-btn:hover{ filter: brightness(1.15); transform: translateY(-2px); }

@media (max-width: 900px){
  body #auth .auth-shell{ padding-top: 36px; padding-left: 10px; padding-right: 10px; }
  body #auth .auth-hero-headline,
  body #auth .auth-card::before,
  body #auth .auth-connect-title{ font-size: clamp(13px, 4vw, 18px); padding: 6px 16px 8px; white-space: normal; }
  body #auth .auth-hero::after,
  body #auth .auth-card::after,
  body #auth .auth-event-card::after,
  body #auth .auth-connect-card::after{ inset: -10px; background-size: 40px 31px; }
}
@media (prefers-reduced-motion: reduce){
  body #auth .auth-btn, body #auth .auth-connect-btn, body #auth .auth-field{ transition: none; }
}
