/* ============================================================
   Heavy Metal Brothers — Login Module
   mod_hmb_login.css  v1.0
   ============================================================ */

@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');

/* ─── Design Tokens (same as register) ──────────────────── */
.hmb-login-module {
    --c-bg:         #080808;
    --c-surface:    #0f0f0f;
    --c-border:     #2a2a2a;
    --c-red:        #b41414;
    --c-red-hi:     #e02020;
    --c-red-glow:   rgba(180, 20, 20, 0.35);
    --c-gold:       #c9a84c;
    --c-gold-dim:   #7a6030;
    --c-silver:     #888;
    --c-muted:      #555;
    --c-text:       #d4d4d4;
    --c-text-hi:    #f0ebe0;
    --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;
}

/* ─── Module Shell ───────────────────────────────────────── */
.hmb-login-module {
    font-family: var(--f-body);
    color: var(--c-text);
    max-width: 380px;
    margin: 0 auto;
}

.hmb-login-inner {
    position: relative;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03) inset,
        0 30px 80px rgba(0,0,0,0.9),
        0 0 60px rgba(180, 20, 20, 0.07);
}

/* Top animated bar */
.hmb-login-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #3a0000 0%, var(--c-red) 30%,
        var(--c-gold) 50%,
        var(--c-red) 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 {
    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.03'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

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

/* Ornamental corners */
.hmb-corner {
    position: absolute;
    width: 18px; height: 18px;
    border-color: var(--c-gold-dim);
    border-style: solid;
    opacity: 0.45;
    z-index: 3;
}
.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; }

/* ─── Header ─────────────────────────────────────────────── */
.hmb-login-header {
    padding: 2rem 2.25rem 1.5rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(180,20,20,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: 55px;
    background: linear-gradient(90deg, transparent, var(--c-gold-dim));
}
.hmb-crest-line:last-child {
    background: linear-gradient(90deg, var(--c-gold-dim), 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(180,20,20,0.3)); }
    50%       { filter: drop-shadow(0 0 12px rgba(180,20,20,0.65)); }
}

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

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

/* ─── Body ───────────────────────────────────────────────── */
.hmb-login-body {
    padding: 1.6rem 2rem 1.75rem;
}

/* ─── Alert ──────────────────────────────────────────────── */
.hmb-alert {
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    font-size: 0.8rem;
    margin-bottom: 1.1rem;
    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(180,20,20,0.1); border-color: rgba(180,20,20,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.85rem;
}

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

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

/* Input with trailing icon */
.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 var(--c-border);
    border-radius: var(--radius);
    color: #ffffff !important;
    font-family: var(--f-body);
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    padding: 0.62rem 2.4rem 0.62rem 0.85rem;
    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.3); font-style: italic; font-weight: 300; }
.hmb-input:hover:not(:focus) { border-color: #383838; }
.hmb-input:focus {
    outline: none;
    border-color: var(--c-red);
    background: rgba(180,20,20,0.05);
    box-shadow: 0 0 0 3px rgba(180,20,20,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(--c-text-hi);
    -webkit-box-shadow: 0 0 0 1000px #120202 inset;
}

/* User icon inside input */
.hmb-input-icon {
    position: absolute;
    right: 0.7rem; top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    pointer-events: none;
    display: flex; align-items: center;
}
.hmb-input-icon svg { width: 1rem; height: 1rem; }

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

/* ─── Remember 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 var(--c-border);
    border-radius: 2px;
    background: rgba(255,255,255,0.03);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition:
        border-color var(--speed) var(--ease),
        background var(--speed) var(--ease);
    position: relative;
}

.hmb-check-box::after {
    content: '';
    position: absolute;
    width: 5px; height: 8px;
    border: 2px solid var(--c-red-hi);
    border-top: none; border-left: none;
    transform: rotate(45deg) scale(0) translateY(-1px);
    transition: transform 0.15s var(--ease);
}

.hmb-checkbox:checked + .hmb-check-box {
    background: rgba(180,20,20,0.15);
    border-color: var(--c-red);
}
.hmb-checkbox:checked + .hmb-check-box::after {
    transform: rotate(45deg) scale(1) translateY(-1px);
}
.hmb-checkbox:focus-visible + .hmb-check-box {
    box-shadow: 0 0 0 3px rgba(180,20,20,0.25);
}

.hmb-check-text {
    font-family: var(--f-heading);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-silver);
}

/* ─── 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, #c01010 0%, #7a0a0a 100%);
    border: 1px solid rgba(180,20,20,0.5);
    border-bottom-color: rgba(60,5,5,0.8);
    border-radius: var(--radius);
    color: var(--c-text-hi);
    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(180,20,20,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; }

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

/* Loading state */
.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); } }

/* ─── Helper links ───────────────────────────────────────── */
.hmb-links {
    list-style: none;
    margin: 1.1rem 0 0;
    padding: 0;
    border-top: 1px solid var(--c-border);
    padding-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hmb-links li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--c-silver);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color var(--speed) var(--ease);
    padding: 0.1rem 0;
}

.hmb-links li a:hover { color: var(--c-text-hi); }

.hmb-link-bullet {
    font-size: 0.45rem;
    color: var(--c-red);
    flex-shrink: 0;
    transition: color var(--speed) var(--ease);
}

.hmb-link-register {
    color: var(--c-red-hi) !important;
    font-weight: 600 !important;
}
.hmb-link-register:hover { color: var(--c-gold) !important; }
.hmb-link-register .hmb-link-bullet { color: var(--c-gold-dim); }

.hmb-link-arrow {
    font-size: 0.6em;
    transition: transform var(--speed) var(--ease);
    opacity: 0.7;
}
.hmb-link-register:hover .hmb-link-arrow { transform: translateX(3px); opacity: 1; }

/* ─── Footer ─────────────────────────────────────────────── */
.hmb-login-footer {
    padding: 0.85rem 2rem 1.2rem;
    border-top: 1px solid var(--c-border);
    text-align: center;
    font-size: 0.77rem;
    color: var(--c-muted);
    letter-spacing: 0.02em;
    background: rgba(0,0,0,0.25);
}
.hmb-login-footer a {
    color: var(--c-red-hi);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--speed) var(--ease);
    margin-left: 0.25rem;
}
.hmb-login-footer a:hover { color: var(--c-gold); }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 480px) {
    .hmb-login-header { padding: 1.6rem 1.4rem 1.25rem; }
    .hmb-login-body   { padding: 1.4rem 1.4rem 1.5rem; }
    .hmb-login-footer { padding: 0.8rem 1.4rem 1.1rem; }
    .hmb-login-title  { font-size: 1.05rem; }
}
