/* ===================================================
   Age Gate – CSS
   Dark luxury aesthetic with gold accents
   Developed by YeloCommerce.com
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300&family=Jost:wght@300;400;500&display=swap');

:root {
    --ag-bg:       #0a0a0f;
    --ag-accent:   #c8a96e;
    --ag-text:     #f0ece4;
    --ag-card-bg:  rgba(14, 14, 22, 0.97);
    --ag-border:   rgba(200, 169, 110, 0.25);
    --ag-input-bg: rgba(255,255,255,0.04);
    --ag-radius:   6px;
    --ag-font-display: 'Cormorant Garamond', Georgia, serif;
    --ag-font-body:    'Jost', sans-serif;
    --ag-transition:   0.3s cubic-bezier(0.4,0,0.2,1);
}
.ag-body-backdrop{
    filter: blur(15px);
}
/* ── Overlay ─────────────────────────────────────── */
#age-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: var(--ag-font-body);
    color: var(--ag-text);
    overflow-y: auto;
}

.ag-backdrop {
    position: fixed;
    inset: 0;
    background: var(--ag-bg);
    /* Subtle noise grain */
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(200,169,110,0.06) 0%, transparent 70%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: cover, 300px 300px;
    z-index: 0;
}

/* ── Card ────────────────────────────────────────── */
.ag-card {
    position: relative;
    z-index: 1;
    background: var(--ag-card-bg);
    border: 1px solid var(--ag-border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    padding: 0 0 2rem;
    box-shadow:
        0 0 0 1px rgba(200,169,110,0.05),
        0 32px 80px rgba(0,0,0,0.7),
        0 0 120px rgba(200,169,110,0.04);
    animation: ag-card-in 0.6s cubic-bezier(0.22,1,0.36,1) both;
    overflow: hidden;
}

@keyframes ag-card-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── Top / Bottom decorative bars ───────────────── */
.ag-topbar {
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--ag-accent) 40%, transparent 100%);
    margin-bottom: 2rem;
}

.ag-bottombar {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--ag-border) 50%, transparent 100%);
    margin: 1.5rem 2.5rem 0;
}

/* ── Brand ───────────────────────────────────────── */
.ag-brand {
    text-align: center;
    padding: 0 2.5rem;
    margin-bottom: 1.25rem;
}

.ag-logo {
    max-height: 150px;
    max-width: 200px;
    object-fit: contain;
}

.ag-site-title {
    font-family: var(--ag-font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ag-accent);
}

/* ── Shield icon ─────────────────────────────────── */
.ag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.ag-icon svg {
    width: 48px;
    height: 48px;
    color: var(--ag-accent);
    filter: drop-shadow(0 0 12px rgba(200,169,110,0.4));
    animation: ag-pulse 3s ease-in-out infinite;
}

@keyframes ag-pulse {
    0%, 100% { filter: drop-shadow(0 0 12px rgba(200,169,110,0.4)); }
    50%       { filter: drop-shadow(0 0 20px rgba(200,169,110,0.7)); }
}

/* ── Headline ────────────────────────────────────── */
.ag-headline {
    font-family: var(--ag-font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    text-align: center;
    color: var(--ag-text);
    margin: 0 2.5rem 0.75rem;
    line-height: 1.2;
}

.ag-subheadline {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(240,236,228,0.65);
    text-align: center;
    margin: 0 5rem 2rem;
}

/* ── Divider line ────────────────────────────────── */
.ag-headline::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--ag-accent);
    margin: 0.85rem auto 0;
    opacity: 0.6;
}

/* ── Form ────────────────────────────────────────── */
.ag-form {
    padding: 0 2.5rem;
}

.ag-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ag-accent);
    font-weight: 500;
    margin-bottom: 0.75rem;
    text-align: center;
}

.ag-dob-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ag-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ag-field label {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(240,236,228,0.45);
    font-weight: 400;
}

.ag-field select,
.ag-field input[type="number"] {
    background: var(--ag-input-bg);
    border: 1px solid var(--ag-border);
    color: var(--ag-text);
    border-radius: var(--ag-radius);
    padding: 0.65rem 0.75rem;
    font-family: var(--ag-font-body);
    font-size: 0.9rem;
    font-weight: 400;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    transition: border-color var(--ag-transition), box-shadow var(--ag-transition);
}

.ag-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a96e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.ag-field select option {
    background: #14141f;
    color: var(--ag-text);
}

.ag-field select:focus,
.ag-field input:focus {
    border-color: var(--ag-accent);
    box-shadow: 0 0 0 3px rgba(200,169,110,0.12);
}

.ag-field input[type="number"]::-webkit-outer-spin-button,
.ag-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ── Remember Me ─────────────────────────────────── */
.ag-remember {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.8rem;
    color: rgba(240,236,228,0.55);
    margin-bottom: 1.25rem;
    user-select: none;
}

.ag-remember input[type="checkbox"] {
    display: none;
}

.ag-checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid var(--ag-border);
    border-radius: 3px;
    background: var(--ag-input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--ag-transition);
}

.ag-remember input:checked + .ag-checkmark {
    background: var(--ag-accent);
    border-color: var(--ag-accent);
}

.ag-remember input:checked + .ag-checkmark::after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    border: 2px solid #0a0a0f;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg) translateY(-1px);
}

/* ── Error ───────────────────────────────────────── */
.ag-error {
    display: none;
    background: rgba(200, 60, 60, 0.12);
    border: 1px solid rgba(200, 60, 60, 0.35);
    border-radius: var(--ag-radius);
    padding: 0.65rem 0.9rem;
    font-size: 0.82rem;
    color: #f0a0a0;
    margin-bottom: 1rem;
    line-height: 1.5;
    animation: ag-shake 0.4s ease;
}

.ag-error.visible { display: block; }

@keyframes ag-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* ── Action buttons ──────────────────────────────── */
.ag-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.ag-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.9rem 1.5rem;
    border-radius: var(--ag-radius);
    font-family: var(--ag-font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all var(--ag-transition);
    position: relative;
    overflow: hidden;
}

.ag-btn--primary {
    background: var(--ag-accent);
    color: #0a0a0f;
}

.ag-btn--primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--ag-transition);
}

.ag-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(200,169,110,0.35);
}

.ag-btn--primary:hover::after { opacity: 1; }
.ag-btn--primary:active  { transform: translateY(0); }

.ag-btn--primary.ag-loading {
    pointer-events: none;
    opacity: 0.8;
}

.ag-btn--primary.ag-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(10,10,15,0.4);
    border-top-color: #0a0a0f;
    border-radius: 50%;
    animation: ag-spin 0.7s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

@keyframes ag-spin {
    to { transform: rotate(360deg); }
}

.ag-btn--secondary {
    background: transparent;
    color: rgba(240,236,228,0.4);
    border: 1px solid rgba(240,236,228,0.1);
    font-size: 0.75rem;
}

.ag-btn--secondary:hover {
    color: rgba(240,236,228,0.7);
    border-color: rgba(240,236,228,0.25);
}

/* ── Legal ───────────────────────────────────────── */
.ag-legal {
    font-size: 0.72rem;
    color: rgba(240,236,228,0.3);
    text-align: center;
    margin: 1.5rem 2.5rem 0;
    line-height: 1.6;
}

.ag-legal a {
    color: var(--ag-accent);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity var(--ag-transition);
}

.ag-legal a:hover { opacity: 1; }

/* ── Responsive ──────────────────────────────────── */
@media ( max-width: 480px ) {
    .ag-card {
        border-radius: 8px;
    }
    .ag-form,
    .ag-subheadline,
    .ag-headline,
    .ag-legal {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        padding-left: 0;
        padding-right: 0;
    }
    .ag-form { padding: 0 1.5rem; }
    .ag-dob-row { grid-template-columns: 1fr 1fr; }
    .ag-field--year { grid-column: 1 / -1; }
}

/* ── Success fade-out ────────────────────────────── */
#age-gate-overlay.ag-dismiss {
    animation: ag-dismiss 0.55s cubic-bezier(0.4,0,1,1) forwards;
}

@keyframes ag-dismiss {
    to { opacity: 0; pointer-events: none; }
}
