body.hd-auth-page {
    --primary-color: #0f8ec6;
    --primary-color-rgb: 15, 142, 198;
    --primary-color-dark: #0b73a8;
    --hd-border: #e5e9f0;
    --text-primary: #252936;
    --text-secondary: #505866;
    --text-muted: #8991a1;
    min-height: 100dvh;
    padding: 28px;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 12% 14%, rgba(15, 142, 198, .16), transparent 32%),
        radial-gradient(circle at 88% 86%, rgba(56, 189, 248, .14), transparent 31%),
        #f4f7fb;
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.hd-auth-frame {
    position: relative;
    z-index: 5;
    width: min(980px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, .95fr);
    overflow: hidden;
    border: 1px solid rgba(15, 142, 198, .13);
    border-radius: 30px;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.hd-auth-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 54px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #075c84 0%, #0f8ec6 54%, #38bdf8 125%);
}

/* Старите page-specific typography/icon правила не смеат да ја пребришат
   белата intro палета на signup/forgot/submit страниците. */
.hd-auth-intro,
.hd-auth-intro h2,
.hd-auth-intro p,
.hd-auth-intro span,
.hd-auth-intro i,
.hd-auth-intro .hd-auth-eyebrow,
.hd-auth-intro .hd-auth-feature {
    color: #fff !important;
}

.hd-auth-intro::before,
.hd-auth-intro::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .16);
    pointer-events: none;
}
.hd-auth-intro::before { width: 360px; height: 360px; right: -190px; top: -120px; }
.hd-auth-intro::after { width: 260px; height: 260px; left: -150px; bottom: -130px; }

.hd-auth-brand { position: relative; z-index: 1; }
.hd-auth-brandmark {
    width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
    border-radius: 18px; margin-bottom: 28px; font-size: 23px;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}
.hd-auth-eyebrow { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .14em; opacity: .76; }
.hd-auth-intro h2 { margin: 10px 0 14px; font-size: clamp(31px, 4vw, 45px); line-height: 1.04; letter-spacing: -.045em; }
.hd-auth-intro > .hd-auth-brand > p { max-width: 430px; margin: 0; line-height: 1.65; color: rgba(255,255,255,.82) !important; }
.hd-auth-features { position: relative; z-index: 1; display: grid; gap: 13px; margin-top: 38px; }
.hd-auth-feature { display: flex; gap: 12px; align-items: center; font-size: 13.5px; font-weight: 550; color: rgba(255,255,255,.9) !important; }
.hd-auth-feature i { width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.13); font-size: 12px; }

.hd-auth-panel { display: flex; align-items: center; justify-content: center; padding: 38px; background: rgba(255,255,255,.9); }

/* The public request form uses the same unified card, with a denser desktop
   layout so the intro does not become an unnecessarily tall empty panel. */
body.hd-auth-submit-page .hd-auth-frame {
    width: min(1160px, 100%);
    grid-template-columns: minmax(0, .9fr) minmax(540px, 1.1fr);
}
body.hd-auth-submit-page .hd-auth-panel { align-items: flex-start; padding: 34px 38px; }
body.hd-auth-page.hd-auth-submit-page .kup-card { max-width: 100%; }
body.hd-auth-submit-page #kupSubmitForma {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
}
body.hd-auth-submit-page #kupSubmitForma .kup-field { margin: 0; }
body.hd-auth-submit-page #kupSubmitForma .hd-submit-full,
body.hd-auth-submit-page #kupSubmitForma > button { grid-column: 1 / -1; }
body.hd-auth-submit-page #kupSubmitForma .hd-auth-control textarea { min-height: 112px; }
body.hd-auth-page #kupSignupForma {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px 18px;
}
body.hd-auth-page #kupSignupForma .kup-field { margin: 0; }
body.hd-auth-page #kupSignupForma .kup-field:nth-child(5),
body.hd-auth-page #kupSignupForma > button { grid-column: 1 / -1; }
body.hd-auth-page #kupSignupForma + .kup-link-row { text-align: center; }
body.hd-auth-signup-page .hd-auth-frame {
    width: min(1080px, 100%);
    grid-template-columns: minmax(0, .95fr) minmax(520px, 1.05fr);
}
body.hd-auth-page.hd-auth-signup-page .kup-card { max-width: 100%; }
body.hd-auth-page .kup-auth-shell { width: 100%; min-height: calc(100dvh - 56px); padding: 0; align-items: center; }
body.hd-auth-page .kup-card {
    width: 100%; max-width: 390px; padding: 12px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
body.hd-auth-page .kup-card h1,
body.hd-auth-page .login-title { margin: 0 0 8px; text-align: left; color: var(--text-primary); font-size: 29px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em; }
body.hd-auth-page .kup-card p.subtitle,
body.hd-auth-page .login-sub { margin: 0 0 30px; text-align: left; color: var(--text-muted); opacity: 1; font-size: 14px; line-height: 1.55; }
body.hd-auth-page .hd-auth-form { display: block; }
body.hd-auth-page .kup-field { margin: 0 0 18px; }
body.hd-auth-page .kup-field label,
body.hd-auth-page .login-field-label { display: block; margin: 0 0 8px; color: var(--text-secondary); opacity: 1; font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.hd-auth-control { position: relative; }
.hd-auth-control > i,
.hd-auth-control > .hd-auth-field-icon {
    position: absolute; left: 17px; top: 50%; z-index: 1;
    transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none;
}
.hd-auth-control > .hd-auth-field-icon { width: 19px; height: 19px; }
.hd-auth-control > .hd-auth-field-icon svg,
.hd-auth-phone-icon svg,
.hd-auth-file-button svg,
.hd-auth-urgent-icon svg,
.hd-auth-choice-mark svg,
.hd-auth-button-icon { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hd-auth-control--textarea > i,
.hd-auth-control--textarea > .hd-auth-field-icon { top: 17px; transform: none; }
body.hd-auth-page .hd-auth-control input:not([type="checkbox"]):not([type="file"]),
body.hd-auth-page .hd-auth-control textarea,
body.hd-auth-page .hd-auth-control select {
    display: block; width: 100%; min-height: 50px; box-sizing: border-box;
    margin: 0; padding: 14px 16px 14px 48px !important;
    border: 1px solid var(--hd-border) !important; border-radius: 12px !important;
    outline: none; background: #f8fafc; color: var(--text-primary);
    font: inherit; font-size: 15px; line-height: 1.35;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    appearance: none;
}
body.hd-auth-page .hd-auth-control textarea { min-height: 132px; padding-top: 14px !important; resize: vertical; }
body.hd-auth-page .hd-auth-control input::placeholder,
body.hd-auth-page .hd-auth-control textarea::placeholder { color: #a3aab7; opacity: 1; }
body.hd-auth-page .hd-auth-control input:focus,
body.hd-auth-page .hd-auth-control textarea:focus,
body.hd-auth-page .hd-auth-control select:focus {
    border-color: var(--primary-color) !important; background: #fff;
    box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), .12);
}
body.hd-auth-page .hd-auth-control:focus-within > i,
body.hd-auth-page .hd-auth-control:focus-within > .hd-auth-field-icon { color: var(--primary-color); }
.hd-auth-select::after {
    content: ''; position: absolute; right: 18px; top: calc(50% - 5px); width: 8px; height: 8px;
    border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); pointer-events: none;
}
.hd-auth-file {
    position: relative; display: flex; align-items: center; min-height: 54px; padding: 8px;
    border: 1px dashed rgba(var(--primary-color-rgb), .38); border-radius: 12px; background: #f8fcff;
}
body.hd-auth-page .hd-auth-file input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.hd-auth-file-button {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 0 0 !important;
    padding: 9px 12px; border-radius: 9px; background: rgba(var(--primary-color-rgb), .11);
    color: var(--primary-color-dark) !important; font-size: 13px !important; font-weight: 700 !important; cursor: pointer;
}
.hd-auth-file-button i { color: currentColor; }
.hd-auth-file-state { min-width: 0; overflow: hidden; color: var(--text-muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.hd-auth-help { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; line-height: 1.45; }
.hd-auth-phone {
    display: flex; align-items: stretch; min-height: 50px; overflow: hidden;
    border: 1px solid var(--hd-border); border-radius: 12px; background: #f8fafc;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.hd-auth-phone:focus-within { border-color: var(--primary-color); background: #fff; box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), .12); }
.hd-auth-phone-icon,
.hd-auth-phone-prefix { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hd-auth-phone-icon { width: 46px; color: var(--text-muted); }
.hd-auth-phone-icon svg { width: 18px; height: 18px; }
.hd-auth-phone-prefix { padding: 0 12px; border-left: 1px solid var(--hd-border); border-right: 1px solid var(--hd-border); color: var(--text-secondary); font-size: 14px; font-weight: 750; }
body.hd-auth-page .hd-auth-phone input:not([type="checkbox"]):not([type="file"]) {
    flex: 1; min-width: 0; width: auto; min-height: 48px; padding: 13px 14px !important;
    border: 0 !important; border-radius: 0 !important; background: transparent; box-shadow: none !important;
}
.hd-auth-terms { padding: 14px 15px; border: 1px solid var(--hd-border); border-radius: 12px; background: #f8fafc; transition: border-color .2s, background .2s, box-shadow .2s; }
.hd-auth-terms.is-selected,
.hd-auth-terms:has(input:checked) { border-color: rgba(var(--primary-color-rgb), .55); background: #f2faff; box-shadow: 0 0 0 4px rgba(var(--primary-color-rgb), .08); }
body.hd-auth-page .kup-field .hd-auth-terms-check { display: flex !important; align-items: center; gap: 12px; margin: 0; cursor: pointer; text-transform: none; }
body.hd-auth-page .hd-auth-terms-check input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip-path: inset(50%); }
.hd-auth-terms-copy { min-width: 0; flex: 1; display: grid; gap: 3px; color: var(--text-secondary); font-size: 12.5px; font-weight: 500; line-height: 1.5; }
.hd-auth-terms-copy strong { color: var(--text-primary); font-size: 13px; }
.hd-auth-terms-copy small { color: var(--text-secondary); font: inherit; }
.hd-auth-terms details { margin: 11px 36px 0 0; padding-top: 10px; border-top: 1px solid var(--hd-border); color: var(--text-muted); font-size: 12px; line-height: 1.55; }
.hd-auth-terms summary { color: var(--primary-color-dark); font-weight: 700; cursor: pointer; }
.hd-auth-terms details p { margin: 8px 0 0; }
.hd-auth-urgent {
    display: flex !important; align-items: center; gap: 12px; margin: 0 !important; padding: 13px 15px;
    border: 1px solid var(--hd-border); border-radius: 12px; background: #fff; cursor: pointer;
    text-transform: none !important; transition: border-color .2s, background .2s, box-shadow .2s;
}
.hd-auth-urgent input { position: absolute; opacity: 0; pointer-events: none; }
.hd-auth-urgent-icon { width: 38px; height: 38px; flex: 0 0 38px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: #f1f5f9; color: #64748b; }
.hd-auth-urgent-icon svg { width: 18px; height: 18px; }
.hd-auth-urgent > span:nth-of-type(2) { min-width: 0; flex: 1; display: grid; gap: 2px; }
.hd-auth-urgent strong { color: var(--text-primary); font-size: 13px; letter-spacing: .025em; }
.hd-auth-urgent small { color: var(--text-secondary); font-size: 11.5px; font-weight: 500; line-height: 1.45; }
.hd-auth-choice-mark {
    width: 24px; height: 24px; flex: 0 0 24px; display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid #cbd5e1; border-radius: 7px; background: #fff; color: transparent; font-size: 11px;
    transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.hd-auth-choice-mark svg { width: 14px; height: 14px; stroke-width: 2.6; }
.hd-auth-urgent.is-selected,
.hd-auth-urgent:has(input:checked) { border-color: #dc2626; background: #fff5f5; box-shadow: 0 0 0 4px rgba(220,38,38,.08); }
.hd-auth-urgent.is-selected .hd-auth-urgent-icon,
.hd-auth-urgent:has(input:checked) .hd-auth-urgent-icon { background: #dc2626; color: #fff; animation: hd-urgent-pulse 1.5s ease-in-out infinite; }
.hd-auth-urgent.is-selected strong,
.hd-auth-urgent:has(input:checked) strong { color: #b91c1c; }
.hd-auth-urgent.is-selected small,
.hd-auth-urgent:has(input:checked) small { color: #7f1d1d; }
.hd-auth-urgent.is-selected .hd-auth-choice-mark,
.hd-auth-urgent:has(input:checked) .hd-auth-choice-mark { border-color: #dc2626; background: #dc2626; color: #fff; transform: scale(1.04); }
.hd-auth-terms.is-selected .hd-auth-choice-mark,
.hd-auth-terms:has(input:checked) .hd-auth-choice-mark { border-color: var(--primary-color); background: var(--primary-color); color: #fff; transform: scale(1.04); }
.hd-auth-urgent:focus-within,
.hd-auth-terms:focus-within { outline: 3px solid rgba(var(--primary-color-rgb), .14); outline-offset: 2px; }
@keyframes hd-urgent-pulse { 50% { box-shadow: 0 0 0 7px rgba(220,38,38,.12); } }
body.hd-auth-page .hd-auth-file input[type="file"] { width: 100%; color: var(--text-secondary); font: inherit; font-size: 13px; }
body.hd-auth-page .hd-auth-file input[type="file"]::file-selector-button {
    margin-right: 10px; padding: 9px 12px; border: 0; border-radius: 9px;
    background: rgba(var(--primary-color-rgb), .11); color: var(--primary-color-dark); font-weight: 650; cursor: pointer;
}
body.hd-auth-page button.login-btn,
body.hd-auth-page button.kup-btn[type="submit"] {
    width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 9px;
    margin: 8px 0 0; padding: 14px 18px; border: 0; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark)); color: #fff;
    font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
    box-shadow: 0 8px 20px rgba(var(--primary-color-rgb), .25);
    transition: transform .2s ease, box-shadow .2s ease;
}
body.hd-auth-page button.login-btn:hover,
body.hd-auth-page button.kup-btn[type="submit"]:hover { transform: translateY(-2px); box-shadow: 0 12px 27px rgba(var(--primary-color-rgb), .33); }
body.hd-auth-page button.login-btn,
body.hd-auth-page button.login-btn span,
body.hd-auth-page button.login-btn i,
body.hd-auth-page button.login-btn svg,
body.hd-auth-page button.kup-btn[type="submit"],
body.hd-auth-page button.kup-btn[type="submit"] span,
body.hd-auth-page button.kup-btn[type="submit"] i,
body.hd-auth-page button.kup-btn[type="submit"] svg { color: #fff !important; }
.hd-auth-button-icon { width: 19px; height: 19px; }
body.hd-auth-page .kup-link-row { margin-top: 18px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
body.hd-auth-page .kup-link-row a { color: var(--primary-color-dark); font-weight: 650; text-decoration: none; }
body.hd-auth-page .kup-link-row a:hover { text-decoration: none; color: var(--primary-color); }
body.hd-auth-page .kup-msg { margin: 0 0 18px; border-radius: 11px; line-height: 1.5; }
body.hd-auth-page .login-card {
    width: 100%; max-width: 390px; padding: 12px 0; border: 0; border-radius: 0;
    background: transparent; box-shadow: none; transform: none;
}
body.hd-auth-page .login-card:hover { transform: none; box-shadow: none; }
.hd-auth-panel-brand { display: none; }
.login-field-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 650; color: var(--text-secondary); }
.hd-auth-links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.hd-auth-links a {
    min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px;
    text-decoration: none; text-align: center; padding: 8px 10px; border-radius: 11px;
    border: 1px solid var(--hd-border); color: var(--text-secondary); font-size: 12.5px; font-weight: 600;
    transition: .2s ease;
}
.hd-auth-links a:hover { border-color: rgba(var(--primary-color-rgb), .35); color: var(--primary-color-dark); background: #f4fbff; }
.hd-auth-links a:last-child { grid-column: 1 / -1; }
body.hd-auth-page .login-langs { margin-top: 24px; }
body.hd-auth-page .login-foot { margin-top: 18px; }

@media (max-width: 800px) {
    body.hd-auth-page { padding: 14px; align-items: flex-start; }
    body.hd-auth-page input:not([type="checkbox"]):not([type="file"]),
    body.hd-auth-page select,
    body.hd-auth-page textarea { font-size: 16px !important; }
    .hd-auth-frame { width: 100%; max-width: 100%; grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 24px; }
    .hd-auth-intro { padding: 28px; min-height: 190px; }
    .hd-auth-brandmark { width: 46px; height: 46px; border-radius: 14px; margin-bottom: 18px; }
    .hd-auth-intro h2 { font-size: 31px; margin-bottom: 8px; }
    .hd-auth-features { display: none; }
    .hd-auth-panel { min-width: 0; padding: 30px 24px; }
    body.hd-auth-page .login-card,
    body.hd-auth-page .kup-card { min-width: 0; max-width: 100%; margin: 0; box-sizing: border-box; }
    body.hd-auth-page .kup-auth-shell { align-items: flex-start; }
    body.hd-auth-submit-page .hd-auth-frame { grid-template-columns: 1fr; }
    body.hd-auth-submit-page .hd-auth-panel { padding: 30px 24px; }
    body.hd-auth-submit-page #kupSubmitForma { grid-template-columns: 1fr; }
    body.hd-auth-submit-page #kupSubmitForma .hd-submit-full,
    body.hd-auth-submit-page #kupSubmitForma > button { grid-column: auto; }
    body.hd-auth-page #kupSignupForma { grid-template-columns: 1fr; }
    body.hd-auth-page #kupSignupForma .kup-field:nth-child(5),
    body.hd-auth-page #kupSignupForma > button { grid-column: auto; }
    body.hd-auth-signup-page .hd-auth-frame { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
    body.hd-auth-page { padding: 0; background: #fff; }
    .hd-auth-frame { border: 0; border-radius: 0; box-shadow: none; min-height: 100dvh; }
    .hd-auth-intro { min-height: 165px; padding: 23px; }
    .hd-auth-intro h2 { font-size: 27px; }
    .hd-auth-intro > .hd-auth-brand > p { font-size: 13px; }
    .hd-auth-panel { align-items: flex-start; padding: 28px 20px 36px; }
    .hd-auth-links { grid-template-columns: 1fr; }
    .hd-auth-links a:last-child { grid-column: auto; }
}
