/* Login/register only. Shared compressed scene slices and panel; live HTML controls and configurable copy. */
@font-face { font-family:"Candy Nunito"; font-style:normal; font-weight:900; font-display:swap; src:url('../fonts/nunito/nunito-900-v1.ttf') format('truetype'); }
html:has(body.auth-candy-page) { background:#1DB6FE; overflow-x:hidden; }
body.ui-v3.auth-candy-page,body.ui-v3.auth-candy-page.dark {
    --v3-text:#613516; --v3-muted:#8b6a4d; --v3-muted-strong:#613516; --v3-purple:#326a25; --v3-line:#cfad80;
    min-width:0; height:auto!important; min-height:100svh; margin:0; padding:0; background:#1DB6FE;
    color:#613516; color-scheme:light; overflow:visible; font-family:"Candy Nunito","Microsoft YaHei",sans-serif;
}
.auth-candy-page .dark-toggle,.auth-candy-page .install-app-btn,.auth-candy-page .cs-float-btn { display:none!important; }
body.auth-candy-page .v3-auth {
    --scene-width:min(100vw,480px); width:100%; max-width:480px; min-height:max(100svh,calc(var(--scene-width) * 1.78));
    margin:0 auto; padding:0 11% calc(82px + env(safe-area-inset-bottom,0px));
    position:relative; isolation:isolate; overflow:visible;
    /* Match the pre-redesign layout: background begins at the document origin.
       Do not add a device inset to the scene, form or ground seam, or change OS chrome. */
    /* Paint-only transition inside the page; no inset, layout shift or fixed overlay.
       Match the existing theme colour at the edge, then reveal the unchanged artwork. */
    background-color:#1DB6FE;
    background-image:linear-gradient(to bottom,#1DB6FE 0px,#1DB6FE 2px,rgba(29,182,254,.82) 20%,rgba(29,182,254,.38) 55%,rgba(29,182,254,0) 100%),url('../images/farm/auth/wood-scene-v1.webp');
    background-position:center top,center top;
    background-size:100% clamp(24px,8vw,36px),100% auto;
    background-repeat:no-repeat;
}
@media(min-width:480px) { body.auth-candy-page .v3-auth { padding-inline:53px; } }
body.auth-candy-page .v3-auth::before { display:none; }
/* Only the grass/path extends vertically. The farmer, trees and sign keep their proportions. */
body.auth-candy-page .v3-auth::after { content:""; position:absolute; z-index:-1; inset:calc(var(--scene-width) * .9) 0 0; background:url('../images/farm/auth/wood-ground-v1.webp') center/100% 100% no-repeat; pointer-events:none; }
.candy-auth-hero { position:relative; height:calc(var(--scene-width) * .85); }
.candy-auth-brand { position:absolute; top:calc(var(--scene-width) * .19); left:50%; transform:translateX(-50%); width:calc(var(--scene-width) * .51); height:calc(var(--scene-width) * .20); display:flex; align-items:center; justify-content:center; text-align:center; }
.candy-auth-wordmark { width:100%; }
body.auth-candy-page .candy-auth-wordmark h1 { margin:0; padding:0; color:#fff1c4; font:900 clamp(30px,9.8vw,47px)/1 "Candy Nunito",sans-serif; letter-spacing:-1px; -webkit-text-stroke:3px #813508; paint-order:stroke fill; text-shadow:0 3px #a24509,0 5px 1px #622600; overflow-wrap:anywhere; }
/* Supporting copy remains available to assistive technology. */
.candy-auth-brand p,body.auth-candy-page .v3-panel-heading p,body.auth-candy-page .v3-auth-panel label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
body.ui-v3.auth-candy-page .auth-wood-panel { position:relative; z-index:1; isolation:isolate; width:100%; margin:0; padding:27px 25px 20px; border:0; border-radius:0; background:none; box-shadow:none; overflow:visible; }
body.ui-v3.auth-candy-page .auth-wood-panel::before { content:""; position:absolute; z-index:-1; inset:0; border-style:solid; border-color:transparent; border-width:38px 33px 42px; border-image:url('../images/farm/auth/wood-panel-v1.webp') 100 90 105 90 fill / 38px 33px 42px stretch; pointer-events:none; }
body.auth-candy-page .v3-auth > .v3-auth-panel::after { content:""; position:absolute; top:-42px; left:0; width:100%; height:53px; background-image:repeating-linear-gradient(135deg,#865021 0 2px,#e2ad63 3px 5px,#bd8039 6px 8px),repeating-linear-gradient(135deg,#865021 0 2px,#e2ad63 3px 5px,#bd8039 6px 8px); background-size:6px 100%; background-position:12% 0,88% 0; background-repeat:no-repeat; pointer-events:none; }
body.auth-candy-page .v3-panel-heading { display:block; margin:0 0 17px; padding:0; border:0; text-align:center; }
body.ui-v3.auth-candy-page .v3-panel-heading .candy-ribbon-title { position:static; width:100%; margin:0; padding:0; color:#5b2b10; font:900 clamp(23px,6.6vw,31px)/1.15 "Candy Nunito","Microsoft YaHei",sans-serif; letter-spacing:-.5px; text-shadow:0 1px #fff7de; overflow-wrap:anywhere; }
body.auth-candy-page .v3-auth-panel .v3-form { display:block; }
body.ui-v3.auth-candy-page .v3-input,body.ui-v3.auth-candy-page .v3-select { position:relative; display:flex; align-items:center; min-width:0; min-height:46px; margin:0 0 12px; padding:0; border:1.5px solid #c9a478; border-radius:8px; background:linear-gradient(110deg,#f4e6d0,#fffaf0); box-shadow:inset 0 1px 2px #97642b23,0 1px #fff9e7; }
body.auth-candy-page .v3-input::before,body.auth-candy-page .v3-input::after { display:none; }
body.auth-candy-page .v3-input > svg { width:20px; height:20px; margin-left:10px; color:#947857; stroke:currentColor; stroke-width:2.4; fill:none; flex:none; }
body.ui-v3.auth-candy-page .v3-input input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width:100%; min-width:0; min-height:44px; height:44px; padding:10px 8px; margin:0; border:0; border-radius:7px; background:transparent; box-shadow:none; color:#624329; font:900 16px/1.3 "Candy Nunito","Microsoft YaHei",sans-serif; }
body.ui-v3.auth-candy-page .v3-input input::placeholder { color:#947c63; opacity:1; }
body.auth-candy-page .v3-input:focus-within,body.auth-candy-page .v3-select:focus-within { border-color:#47782e; box-shadow:0 0 0 2px #47782e30; }
body.auth-candy-page .v3-input.is-invalid { border-color:#b43e28; box-shadow:0 0 0 1px #b43e2822; }
body.auth-candy-page .v3-primary-action { position:relative; display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:54px; margin:8px 0 0; padding:10px 14px; border:2px solid #b64e0b; border-radius:12px; background:linear-gradient(170deg,#ffac35 0%,#ff8415 24%,#ff7007 72%,#ef5a03 100%); box-shadow:inset 0 2px 1px #ffcf76,inset 0 -3px #df4e06,0 3px 0 #7c430a66; color:#fff9ea; font:900 25px/1.15 "Candy Nunito",sans-serif; text-shadow:0 2px 1px #8d340c; text-transform:none; letter-spacing:0; touch-action:manipulation; }
body.auth-candy-page .v3-primary-action::before { content:""; position:absolute; left:8px; right:8px; top:4px; height:5px; border-radius:50%; background:linear-gradient(90deg,#fff2b078,#fff2b010); pointer-events:none; }
body.auth-candy-page .v3-primary-action::after,body.auth-candy-page .v3-primary-action > svg { display:none; }
body.auth-candy-page .v3-primary-action:active { transform:translateY(1px); }
body.auth-candy-page .v3-primary-action:disabled { opacity:.65; }
body.auth-candy-page .candy-forgot-row { display:flex; justify-content:flex-end; margin-top:-12px; }
body.auth-candy-page .v3-inline-action { min-height:44px; max-width:100%; padding:6px 0; border:0; border-radius:0; background:none; box-shadow:none; color:#2f6526; font:900 12px/1.2 "Candy Nunito",sans-serif; text-decoration:underline; white-space:normal; touch-action:manipulation; }
body.auth-candy-page .v3-auth-shortcuts { display:block; margin:12px 0 0; padding:0; }
body.auth-candy-page .v3-auth-shortcuts > a,body.auth-candy-page .v3-text-link { display:flex; align-items:center; justify-content:center; gap:10px; min-height:44px; margin:0; padding:4px 0; border:0; border-radius:0; background:none; box-shadow:none; color:#2f6526; font-size:13px; font-weight:900; text-align:center; text-decoration:underline; overflow-wrap:anywhere; touch-action:manipulation; }
body.auth-candy-page .v3-auth-shortcuts > a::before,body.auth-candy-page .v3-auth-shortcuts > a::after,body.auth-candy-page .v3-text-link::before,body.auth-candy-page .v3-text-link::after { content:""; height:1px; flex:1 1 12px; background:#c9a478; min-width:8px; }
body.auth-candy-page .v3-shortcut-icon,body.auth-candy-page .v3-auth-shortcuts small { display:none; }
body.auth-candy-page .v3-form-error { color:#a12d21; font:700 13px/1.4 Arial,sans-serif; background:#fff2e8; border-radius:6px; padding:7px; margin:7px 0; }
body.auth-candy-page [hidden],body.auth-candy-page .farm-auth-hidden,body.auth-candy-page .farm-auth-shortcut-hidden { display:none!important; }
body.auth-candy-page .v3-form-section,body.auth-candy-page .v3-form-section:first-child { padding:0; margin:0; border:0; }
body.auth-candy-page .v3-form-section > header { display:none; }
body.auth-candy-page .v3-form-grid { display:block; }
body.auth-candy-page .v3-register-panel .v3-text-link { margin:12px 0 0; }
body.auth-candy-page .v3-register-panel .v3-text-link::before,body.auth-candy-page .v3-register-panel .v3-text-link::after { display:none; }
body.auth-candy-page .v3-phone-row { display:flex; align-items:start; gap:6px; }
body.auth-candy-page .v3-phone-row .v3-select { flex:0 0 30%; }
body.auth-candy-page .v3-phone-row .v3-input { flex:1 1 0; }
body.ui-v3.auth-candy-page .v3-select select { width:100%; min-width:0; height:44px; min-height:44px; padding:7px 4px; border:0; background:none; box-shadow:none; color:#624329; font-size:16px; text-overflow:ellipsis; }
body.auth-candy-page .v3-code-row { display:flex; gap:6px; }
body.auth-candy-page .v3-code-row .v3-input { flex:1 1 0; }
body.auth-candy-page .v3-code-action { flex:0 0 72px; min-height:46px; margin:0 0 12px; padding:6px; border:1px solid #c0985e; border-radius:8px; background:linear-gradient(#fff7dc,#ecd4a4); color:#5d431f; font-size:12px; }
body.auth-candy-page .v3-sheet { z-index:10010; }
body.ui-v3.auth-candy-page.v3-sheet-open { overflow:hidden; }
body.auth-candy-page .v3-sheet-panel { width:min(100% - 24px,400px); max-height:calc(100dvh - 32px); margin:16px auto; padding:18px; border:3px solid #a56a30; border-radius:18px; background:#fff4dc; color:#613516; }
body.auth-candy-page .v3-sheet-backdrop { background:#35280e88; backdrop-filter:none; }
body.auth-candy-page .v3-sheet-heading h2,body.auth-candy-page .v3-sheet label { color:#613516; }
/* Modal geometry only. Frame, paper and padding come from .auth-wood-panel,
   exactly as on the login/register forms; do not rescale the frame separately. */
body.ui-v3.auth-candy-page #forgot-password-sheet .v3-sheet-panel {
    width:min(calc(100% - 40px),380px); max-height:calc(100dvh - 32px);
    margin:16px auto; padding-bottom:28px; overflow-y:auto; color:#613516;
}
body.ui-v3.auth-candy-page #forgot-password-sheet .v3-sheet-heading { gap:8px; margin:0 0 12px; }
body.ui-v3.auth-candy-page #forgot-password-sheet .v3-sheet-heading h2 { margin:0; color:#5b2b10; font-size:23px; line-height:1.15; }
body.ui-v3.auth-candy-page #forgot-password-sheet .v3-sheet-close { flex:none; color:#754719; border:1px solid #c9a478; background:#f6e4c3; box-shadow:inset 0 1px #fff9e7; border-radius:10px; }
body.ui-v3.auth-candy-page #forgot-password-form > label { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
body.ui-v3.auth-candy-page #forgot-password-sheet .v3-primary-action { font-size:clamp(18px,5.5vw,23px); }
/* Move the existing 8px top gap below the button, preserving the dialog and fields. */
body.ui-v3.auth-candy-page #forgot-password-sheet #reset-submit-btn { margin-top:0; }
body.auth-candy-page :is(button,a):focus-visible { outline:3px solid #326b24; outline-offset:3px; }
body.auth-candy-page .auth-country-status { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 10px; color:#a12d21; font:700 12px/1.4 Arial,sans-serif; }
body.auth-candy-page .auth-country-status button { flex:none; min-height:44px; padding:6px 10px; color:#613516; border:1px solid #c9a478; border-radius:8px; background:#fff4dc; font:700 13px Arial,sans-serif; }
@media(max-width:350px) { body.auth-candy-page .v3-auth { padding-inline:7%; } body.ui-v3.auth-candy-page .auth-wood-panel { padding-inline:22px; } body.auth-candy-page .v3-primary-action { font-size:22px; } }
@media(prefers-reduced-motion:reduce) { body.auth-candy-page *,body.auth-candy-page *::before,body.auth-candy-page *::after { scroll-behavior:auto!important; transition:none!important; } }
