/* ═══════════════════════════════════════════════════
   HQD Age Gate & Cookie Consent – Front-end Styles
   Mobile-first, theme-override safe
   ═══════════════════════════════════════════════════ */

/* ─── Reset: kill any theme styles leaking into our gate ─── */
#hqd-age-gate,
#hqd-age-gate *,
#hqd-age-gate *::before,
#hqd-age-gate *::after,
#hqd-cookie-bar,
#hqd-cookie-bar *,
#hqd-cookie-bar *::before,
#hqd-cookie-bar *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: normal;
    -webkit-text-size-adjust: 100%;
}

/* ─── Age Gate Overlay ─── */
#hqd-age-gate.hqd-ag-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}
#hqd-age-gate.hqd-ag-overlay.hqd-ag-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ─── Backdrop: 90% dark so website shows through at ~10% ─── */
#hqd-age-gate .hqd-ag-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ─── Card: hidden scrollbar, compact ─── */
#hqd-age-gate .hqd-ag-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: rgba(18, 18, 18, 0.96);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 28px 24px 24px;
    text-align: center;
    color: #fff;
    animation: hqd-card-enter 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
#hqd-age-gate .hqd-ag-card::-webkit-scrollbar {
    display: none;
}
@keyframes hqd-card-enter {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Logo ─── */
#hqd-age-gate .hqd-ag-logo {
    display: block;
    max-width: 140px;
    max-height: 50px;
    margin: 0 auto 16px;
}

/* ─── Icon ─── */
#hqd-age-gate .hqd-ag-icon {
    color: var(--hqd-accent, #00d4ff);
    margin-bottom: 12px;
    line-height: 0;
}
#hqd-age-gate .hqd-ag-icon svg {
    width: 38px;
    height: 38px;
}

/* ─── Title & subtitle ─── */
#hqd-age-gate .hqd-ag-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.3;
}
#hqd-age-gate .hqd-ag-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ─── Form ─── */
#hqd-age-gate .hqd-ag-form {
    width: 100%;
}

/* ═══════════════════════════════════════════════════
   DOB FIELDS — compact DD / MM / YYYY in one row
   ═══════════════════════════════════════════════════ */
#hqd-age-gate .hqd-ag-dob-group {
    margin: 0 0 14px;
    text-align: left;
}
#hqd-age-gate .hqd-ag-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* The row: flex, NEVER wraps */
#hqd-age-gate .hqd-ag-dob-fields {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    width: 100% !important;
}

/* Each input wrapper — equal sizing */
#hqd-age-gate .hqd-ag-input-wrap {
    position: relative;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    float: none !important;
}

/* THE INPUTS — compact, forced sizing with !important to beat any theme */
#hqd-age-gate .hqd-ag-input-wrap input[type="text"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    min-height: 0 !important;
    padding: 13px 4px 3px !important;
    margin: 0 !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 0 !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    text-align: center !important;
    transition: border-color 0.2s ease, background 0.2s ease;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    float: none !important;
    line-height: 1 !important;
}
/* Rounded ends */
#hqd-age-gate .hqd-ag-input-wrap:first-child input[type="text"] {
    border-radius: 8px 0 0 8px !important;
}
#hqd-age-gate .hqd-ag-input-wrap:last-child input[type="text"] {
    border-radius: 0 8px 8px 0 !important;
}
/* Remove number spinners */
#hqd-age-gate input::-webkit-outer-spin-button,
#hqd-age-gate input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}
/* Placeholder */
#hqd-age-gate .hqd-ag-input-wrap input[type="text"]::placeholder {
    color: rgba(255,255,255,0.22) !important;
    font-weight: 400 !important;
    font-size: 13px !important;
    letter-spacing: 0.02em !important;
}
/* Focus state */
#hqd-age-gate .hqd-ag-input-wrap input[type="text"]:focus {
    border-color: var(--hqd-accent, #00d4ff) !important;
    background: rgba(255,255,255,0.08) !important;
    z-index: 2;
    position: relative;
}
/* Error state */
#hqd-age-gate .hqd-ag-input-wrap input[type="text"].hqd-ag-input-error {
    border-color: #ff4d6a !important;
    background: rgba(255,77,106,0.08) !important;
}

/* Mini label inside each field */
#hqd-age-gate .hqd-ag-input-label {
    position: absolute;
    top: 3px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    pointer-events: none;
    z-index: 3;
    line-height: 1;
}

/* Separator slash */
#hqd-age-gate .hqd-ag-dob-sep {
    color: rgba(255,255,255,0.2);
    font-size: 16px;
    font-weight: 300;
    flex: 0 0 auto !important;
    width: 14px !important;
    min-width: 14px !important;
    max-width: 14px !important;
    text-align: center;
    line-height: 46px;
}

/* Hint below DOB */
#hqd-age-gate .hqd-ag-dob-hint {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    margin: 6px 0 0;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════
   Checkboxes
   ═══════════════════════════════════════════════════ */
#hqd-age-gate .hqd-ag-checkbox-wrap {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    margin: 0 0 10px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s ease;
}
#hqd-age-gate .hqd-ag-checkbox-wrap:hover {
    background: rgba(255,255,255,0.05);
}
#hqd-age-gate .hqd-ag-checkbox-wrap input[type="checkbox"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 1px 0 0 0 !important;
    background: transparent !important;
    border: 2px solid rgba(255,255,255,0.25) !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex-shrink: 0;
    box-shadow: none !important;
    float: none !important;
}
#hqd-age-gate .hqd-ag-checkbox-wrap input[type="checkbox"]:checked {
    background: var(--hqd-accent, #00d4ff) !important;
    border-color: var(--hqd-accent, #00d4ff) !important;
}
#hqd-age-gate .hqd-ag-checkbox-wrap input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
#hqd-age-gate .hqd-ag-checkbox-text {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255,255,255,0.6);
}
#hqd-age-gate .hqd-ag-checkbox-text a {
    color: var(--hqd-accent, #00d4ff);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ─── Error ─── */
#hqd-age-gate .hqd-ag-error {
    color: #ff4d6a;
    font-size: 12px;
    margin: 0 0 8px;
    min-height: 0;
    text-align: left;
    padding: 0 2px;
    font-weight: 500;
}

/* ─── Buttons ─── */
#hqd-age-gate .hqd-ag-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 12px;
}
#hqd-age-gate .hqd-ag-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.2;
}
#hqd-age-gate .hqd-ag-btn-confirm {
    background: var(--hqd-accent, #00d4ff);
    color: #000;
    box-shadow: 0 4px 18px rgba(0,212,255,0.2);
}
#hqd-age-gate .hqd-ag-btn-confirm:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(0,212,255,0.3);
}
#hqd-age-gate .hqd-ag-btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
#hqd-age-gate .hqd-ag-btn-deny {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.08);
}
#hqd-age-gate .hqd-ag-btn-deny:hover {
    background: rgba(255,77,106,0.12);
    color: #ff4d6a;
    border-color: rgba(255,77,106,0.25);
}
#hqd-age-gate .hqd-ag-btn-text { display: inline; }
#hqd-age-gate .hqd-ag-btn-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: hqd-spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes hqd-spin { to { transform: rotate(360deg); } }

/* ─── Legal footer ─── */
#hqd-age-gate .hqd-ag-legal {
    font-size: 10px;
    color: rgba(255,255,255,0.28);
    line-height: 1.6;
    margin: 0;
}
#hqd-age-gate .hqd-ag-legal a {
    color: rgba(255,255,255,0.4);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════════════
   Cookie Consent Bar
   ═══════════════════════════════════════════════════ */
#hqd-cookie-bar.hqd-cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999998;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 14px 20px;
    animation: hqd-slide-up 0.5s cubic-bezier(0.16,1,0.3,1) both;
    animation-delay: 0.5s;
}
#hqd-cookie-bar.hqd-cookie-hidden {
    animation: hqd-slide-down 0.4s ease forwards;
}
@keyframes hqd-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes hqd-slide-down { from { transform: translateY(0); } to { transform: translateY(100%); } }

#hqd-cookie-bar .hqd-cookie-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
#hqd-cookie-bar .hqd-cookie-text {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}
#hqd-cookie-bar .hqd-cookie-icon {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--hqd-accent, #00d4ff);
}
#hqd-cookie-bar .hqd-cookie-text p {
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255,255,255,0.65);
    margin: 0;
}
#hqd-cookie-bar .hqd-cookie-text a {
    color: var(--hqd-accent, #00d4ff);
    text-decoration: underline;
    text-underline-offset: 2px;
}
#hqd-cookie-bar .hqd-cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
#hqd-cookie-bar .hqd-cookie-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
#hqd-cookie-bar .hqd-cookie-essential {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.65);
    border: 1px solid rgba(255,255,255,0.1);
}
#hqd-cookie-bar .hqd-cookie-essential:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
#hqd-cookie-bar .hqd-cookie-accept {
    background: var(--hqd-accent, #00d4ff);
    color: #000;
}
#hqd-cookie-bar .hqd-cookie-accept:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   Responsive — mobile-first base above,
   enhance for larger screens
   ═══════════════════════════════════════════════════ */
@media (min-width: 480px) {
    #hqd-age-gate .hqd-ag-card {
        padding: 32px 30px 26px;
        max-width: 420px;
        border-radius: 18px;
    }
    #hqd-age-gate .hqd-ag-title { font-size: 22px; }
    #hqd-age-gate .hqd-ag-subtitle { font-size: 14px; }
    #hqd-age-gate .hqd-ag-input-wrap input[type="text"] {
        height: 48px !important;
        font-size: 18px !important;
    }
    #hqd-age-gate .hqd-ag-dob-sep { line-height: 48px; }
    #hqd-age-gate .hqd-ag-checkbox-text { font-size: 12px; }
}

@media (max-width: 359px) {
    #hqd-age-gate .hqd-ag-card {
        padding: 20px 14px 18px;
        border-radius: 12px;
    }
    #hqd-age-gate .hqd-ag-title { font-size: 17px; }
    #hqd-age-gate .hqd-ag-subtitle { font-size: 12px; margin-bottom: 16px; }
    #hqd-age-gate .hqd-ag-icon svg { width: 30px; height: 30px; }
    #hqd-age-gate .hqd-ag-input-wrap input[type="text"] {
        height: 40px !important;
        font-size: 14px !important;
        padding: 11px 2px 2px !important;
    }
    #hqd-age-gate .hqd-ag-dob-sep { width: 10px !important; min-width: 10px !important; font-size: 14px; line-height: 40px; }
    #hqd-age-gate .hqd-ag-input-label { font-size: 7px; }
    #hqd-age-gate .hqd-ag-checkbox-wrap { padding: 8px 10px; gap: 8px; }
    #hqd-age-gate .hqd-ag-checkbox-text { font-size: 10px; }
    #hqd-age-gate .hqd-ag-btn { padding: 10px 14px; font-size: 13px; }
    #hqd-cookie-bar .hqd-cookie-inner { flex-direction: column; text-align: center; }
    #hqd-cookie-bar .hqd-cookie-text { flex-direction: column; align-items: center; }
    #hqd-cookie-bar .hqd-cookie-actions { width: 100%; justify-content: center; }
}
