/**
 * HMB Template — Module Styles
 * Integrates mod_hmb_login and mod_hmb_register using template design tokens
 */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;900&family=Raleway:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ═══════════════════════════════════════════════════════════
   SHARED MODULE TOKENS — mapped to template variables
   ═══════════════════════════════════════════════════════════ */
.hmb-login-module,
.hmb-module {
    --c-bg:       var(--darker);
    --c-surface:  var(--steel);
    --c-border:   #252525;
    --c-red:      var(--fire);
    --c-red-hi:   var(--ember);
    --c-red-glow: rgba(204, 34, 0, 0.35);
    --c-gold:     var(--gold-light);
    --c-gold-dim: var(--gold);
    --c-silver:   var(--text-dim);
    --c-muted:    #484848;
    --c-text:     var(--text);
    --c-text-hi:  var(--white);
    --f-display:  'Cinzel Decorative', 'Cinzel', serif;
    --f-heading:  'Cinzel', serif;
    --f-body:     'Raleway', sans-serif;
    --radius:     3px;
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --speed:      0.22s;
}

/* ═══════════════════════════════════════════════════════════
   SHARED SHELL
   ═══════════════════════════════════════════════════════════ */
.hmb-login-module,
.hmb-module {
    font-family: var(--f-body);
    color: var(--c-text);
    width: 100%;
}

.hmb-login-inner,
.hmb-inner {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 24px 64px rgba(0,0,0,0.85),
        0 0 80px rgba(204,34,0,0.06);
}

/* Animated top bar */
.hmb-login-inner::before,
.hmb-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #3a0000 0%, var(--fire) 30%,
        var(--gold-light) 50%,
        var(--fire) 70%, #3a0000 100%
    );
    background-size: 200% 100%;
    animation: hmbBarShift 4s ease infinite;
    z-index: 2;
}

@keyframes hmbBarShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Noise texture */
.hmb-login-inner::after,
.hmb-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    opacity: 0.35;
    z-index: 0;
}

.hmb-login-inner > *,
.hmb-inner > * { position: relative; z-index: 1; }

/* Ornamental corners */
.hmb-corner {
    position: absolute;
    width: 18px; height: 18px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.4;
    z-index: 4;
}
.hmb-corner-tl { top: 8px;    left: 8px;   border-width: 1px 0 0 1px; }
.hmb-corner-tr { top: 8px;    right: 8px;  border-width: 1px 1px 0 0; }
.hmb-corner-bl { bottom: 8px; left: 8px;   border-width: 0 0 1px 1px; }
.hmb-corner-br { bottom: 8px; right: 8px;  border-width: 0 1px 1px 0; }

/* ═══════════════════════════════════════════════════════════
   CREST & HEADER
   ═══════════════════════════════════════════════════════════ */
.hmb-login-header,
.hmb-panel-header {
    padding: 2rem 2.5rem 1.6rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(204,34,0,0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--c-border);
}

.hmb-crest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    margin-bottom: 0.9rem;
}

.hmb-crest-line {
    flex: 1; height: 1px; max-width: 60px;
    background: linear-gradient(90deg, transparent, var(--gold));
}
.hmb-crest-line:last-child {
    background: linear-gradient(90deg, var(--gold), transparent);
}

.hmb-skull {
    font-size: 1.5rem;
    line-height: 1;
    animation: hmbBreath 4s ease-in-out infinite;
}

@keyframes hmbBreath {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(204,34,0,0.3)); }
    50%       { filter: drop-shadow(0 0 14px rgba(204,34,0,0.7)); }
}

.hmb-login-title,
.hmb-title {
    font-family: var(--f-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--white);
    margin: 0 0 0.35rem;
    text-shadow: 0 2px 20px rgba(204,34,0,0.35);
}

.hmb-login-subtitle,
.hmb-subtitle {
    font-family: var(--f-heading);
    font-size: 0.6rem;
    color: var(--gold-light);
    letter-spacing: 0.28em;
    text-transform: uppercase;
    margin: 0;
    opacity: 0.75;
}

/* ═══════════════════════════════════════════════════════════
   PANEL VISIBILITY (register module tabs)
   ═══════════════════════════════════════════════════════════ */
.hmb-panel { display: none; }
.hmb-panel-active {
    display: block;
    animation: hmbFadeIn 0.3s var(--ease);
}

@keyframes hmbFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════
   BODY
   ═══════════════════════════════════════════════════════════ */
.hmb-login-body,
.hmb-panel-body {
    padding: 1.8rem 2.5rem 2.25rem;
}

/* ═══════════════════════════════════════════════════════════
   ALERT
   ═══════════════════════════════════════════════════════════ */
.hmb-alert {
    border-radius: var(--radius);
    padding: 0.68rem 0.9rem;
    font-size: 0.82rem;
    margin-bottom: 1.2rem;
    border: 1px solid;
    line-height: 1.5;
    animation: hmbFadeSlide 0.25s var(--ease);
}
@keyframes hmbFadeSlide {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hmb-alert-error   { background: rgba(204,34,0,0.1); border-color: rgba(204,34,0,0.4); color: #ff7070; }
.hmb-alert-success { background: rgba(30,120,60,0.1); border-color: rgba(30,120,60,0.4); color: #66d98e; }

/* ═══════════════════════════════════════════════════════════
   FORM
   ═══════════════════════════════════════════════════════════ */
.hmb-form {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.hmb-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.hmb-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.hmb-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}

.hmb-label {
    font-family: var(--f-heading);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.hmb-required { color: var(--ember); }

/* ─── Inputs ─── */
.hmb-input-wrap,
.hmb-password-wrap { position: relative; }

.hmb-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.03);
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    color: var(--white) !important;
    font-family: var(--f-body) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    padding: 0.62rem 2.4rem 0.62rem 0.88rem;
    transition:
        border-color var(--speed) var(--ease),
        background var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease);
    -webkit-appearance: none;
    appearance: none;
}

.hmb-input::placeholder { color: rgba(136,136,136,0.28); font-style: italic; font-weight: 300; }
.hmb-input:hover:not(:focus) { border-color: #363636; }
.hmb-input:focus {
    outline: none;
    border-color: var(--fire);
    background: rgba(204,34,0,0.05);
    box-shadow: 0 0 0 3px rgba(204,34,0,0.12), inset 0 1px 0 rgba(255,255,255,0.04);
}
.hmb-input:-webkit-autofill,
.hmb-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--white) !important;
    -webkit-box-shadow: 0 0 0 1000px #120202 inset;
}

.hmb-input-icon {
    position: absolute;
    right: 0.72rem; top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    display: flex; align-items: center;
}
.hmb-input-icon svg { width: 0.95rem; height: 0.95rem; }

.hmb-eye-toggle {
    position: absolute;
    right: 0.65rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer;
    color: var(--text-dim);
    padding: 0.2rem;
    display: flex; align-items: center;
    transition: color var(--speed) var(--ease);
}
.hmb-eye-toggle:hover { color: var(--ember); }
.hmb-eye-toggle svg { width: 0.9rem; height: 0.9rem; }

/* ─── Checkbox ─── */
.hmb-field-check { margin-top: -0.1rem; }
.hmb-check-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; user-select: none; }
.hmb-checkbox    { position: absolute; opacity: 0; width: 0; height: 0; }

.hmb-check-box {
    width: 15px; height: 15px;
    border: 1px solid #2a2a2a;
    border-radius: 2px;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease);
}
.hmb-check-box::after {
    content: '';
    position: absolute;
    width: 5px; height: 8px;
    top: 1px; left: 4px;
    border: 2px solid var(--ember);
    border-top: none; border-left: none;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s var(--ease);
}
.hmb-checkbox:checked + .hmb-check-box { background: rgba(204,34,0,0.15); border-color: var(--fire); }
.hmb-checkbox:checked + .hmb-check-box::after { transform: rotate(45deg) scale(1); }
.hmb-check-text { font-family: var(--f-heading); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }

/* ─── reCAPTCHA ─── */
.hmb-captcha-wrap { margin-top: 0.25rem; }
.hmb-captcha-label { font-family: var(--f-heading); font-size: 0.59rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); display: block; margin-bottom: 0.5rem; }
.hmb-captcha-wrap .g-recaptcha { display: block !important; line-height: 0; min-height: 78px; }
.hmb-captcha-wrap .g-recaptcha > div,
.hmb-captcha-wrap .g-recaptcha iframe { display: block !important; }

/* ═══════════════════════════════════════════════════════════
   SUBMIT BUTTON
   ═══════════════════════════════════════════════════════════ */
.hmb-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.82rem 1.5rem;
    background: linear-gradient(160deg, var(--fire) 0%, var(--blood) 100%);
    border: 1px solid rgba(204,34,0,0.5);
    border-bottom-color: rgba(60,5,5,0.8);
    border-radius: var(--radius);
    color: var(--white);
    font-family: var(--f-heading);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        transform var(--speed) var(--ease),
        box-shadow var(--speed) var(--ease),
        filter var(--speed) var(--ease);
}
.hmb-btn-submit::after {
    content: '';
    position: absolute;
    top: 0; left: -110%;
    width: 60%; height: 100%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.08) 50%, transparent 70%);
    transition: left 0.5s var(--ease);
}
.hmb-btn-submit:hover::after { left: 150%; }
.hmb-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(204,34,0,0.45), 0 2px 6px rgba(0,0,0,0.6);
    filter: brightness(1.12);
}
.hmb-btn-submit:active  { transform: none; box-shadow: none; }
.hmb-btn-submit:disabled{ opacity: 0.4; cursor: not-allowed; transform: none; }

.hmb-btn-icon { opacity: 0.6; transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease); }
.hmb-btn-submit:hover .hmb-btn-icon { transform: translateX(4px); opacity: 1; }

/* Loading spinner */
.hmb-btn-submit.hmb-loading { pointer-events: none; }
.hmb-btn-submit.hmb-loading .hmb-btn-text::after {
    content: '';
    display: inline-block;
    width: 0.65em; height: 0.65em;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    margin-left: 0.5em;
    vertical-align: middle;
    animation: hmbSpin 0.7s linear infinite;
}
@keyframes hmbSpin { to { transform: rotate(360deg); } }

/* Logout variant */
.hmb-btn-logout {
    background: linear-gradient(160deg, #2a2a2a 0%, #111 100%);
    border-color: #2a2a2a;
}
.hmb-btn-logout:hover {
    background: linear-gradient(160deg, #3a3a3a 0%, #1a1a1a 100%);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════════════
   DIVIDER & GOOGLE
   ═══════════════════════════════════════════════════════════ */
.hmb-divider {
    display: flex; align-items: center; gap: 0.75rem;
    margin: 1.2rem 0;
    color: var(--text-dim);
    font-family: var(--f-heading);
    font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase;
}
.hmb-divider::before, .hmb-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, #2a2a2a, transparent);
}

.hmb-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    width: 100%; padding: 0.7rem 1rem; box-sizing: border-box;
    background: rgba(255,255,255,0.04);
    border: 1px solid #2a2a2a;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.hmb-google-btn:hover { background: rgba(255,255,255,0.07); border-color: #404040; transform: translateY(-1px); }
.hmb-google-icon { width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.hmb-google-text { font-family: var(--f-body); font-size: 0.84rem; font-weight: 600; color: var(--text); }

/* ═══════════════════════════════════════════════════════════
   HELPER LINKS
   ═══════════════════════════════════════════════════════════ */
.hmb-links {
    list-style: none;
    margin: 1rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid #2a2a2a;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.hmb-links li a {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: color var(--speed) var(--ease);
}
.hmb-links li a:hover { color: var(--white); }
.hmb-link-bullet { font-size: 0.45rem; color: var(--fire); flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.hmb-login-footer,
.hmb-panel-footer {
    padding: 0.9rem 2.5rem 1.3rem;
    border-top: 1px solid #2a2a2a;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
    background: rgba(0,0,0,0.2);
}
.hmb-login-footer a { color: var(--ember); text-decoration: none; font-weight: 600; transition: color var(--speed) var(--ease); margin-left: 0.25rem; }
.hmb-login-footer a:hover { color: var(--gold-light); }

.hmb-footer-switch {
    background: none; border: none; cursor: pointer; padding: 0; margin-left: 0.3rem;
    color: var(--ember);
    font-family: var(--f-body); font-size: 0.78rem; font-weight: 600;
    text-decoration: underline;
    transition: color var(--speed) var(--ease);
}
.hmb-footer-switch:hover { color: var(--gold-light); }

.hmb-footer-link { font-size: 0.8rem; color: var(--text-dim); text-decoration: none; transition: color var(--speed) var(--ease); }
.hmb-footer-link:hover { color: var(--gold-light); }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .hmb-login-header,
    .hmb-panel-header  { padding: 1.75rem 1.5rem 1.4rem; }
    .hmb-login-body,
    .hmb-panel-body    { padding: 1.5rem 1.5rem 1.75rem; }
    .hmb-login-footer,
    .hmb-panel-footer  { padding: 0.85rem 1.5rem 1.1rem; }
    .hmb-login-title,
    .hmb-title         { font-size: 1.05rem; }
    .hmb-row, .hmb-row-3 { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 900px) {
    .hmb-row-3 { grid-template-columns: 1fr 1fr; }
}
