/* ==========================================================
   TM Age Gate — Frontend Overlay
   ========================================================== */

#tmag-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999999;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#tmag-modal {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 40px 30px;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Logo */
.tmag-logo {
    margin-bottom: 20px;
}
.tmag-logo img {
    max-width: 220px;
    max-height: 120px;
    height: auto;
    display: inline-block;
}

/* Welcome */
.tmag-welcome {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Heading */
.tmag-heading {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 20px;
    padding: 0;
    background: none !important;
}

/* Error message */
.tmag-error {
    font-size: 15px;
    font-weight: 400;
    font-style: italic;
    line-height: 1.4;
    padding: 12px 20px;
    margin-bottom: 16px;
    border-radius: 6px;
    background: rgba(204,50,50,0.15) !important;
    border: 1px solid rgba(255,255,255,0.15);
}

/* Buttons */
.tmag-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    width: 100%;
}
.tmag-buttons button {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    -webkit-appearance: none;
    line-height: 1.3;
}
.tmag-buttons button:hover {
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
    transform: translateY(-1px);
}
.tmag-buttons button:focus-visible {
    outline: 3px solid cyan;
    outline-offset: 2px;
}
.tmag-buttons button:active {
    transform: scale(0.98);
}

/* Remember me */
.tmag-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    cursor: pointer;
    opacity: 0.9;
}
.tmag-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #5ba5f7;
}

/* Disclaimer */
.tmag-disclaimer {
    max-width: 480px;
    margin: 0 auto;
    font-size: 11px;
    line-height: 1.5;
    opacity: 0.75;
}
.tmag-disclaimer a {
    color: inherit;
    text-decoration: underline;
}
.tmag-disclaimer a:hover {
    opacity: 1;
    color: dodgerblue;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media screen and (max-width: 600px) {
    #tmag-modal {
        padding: 30px 20px;
    }
    .tmag-heading {
        font-size: 20px;
    }
    .tmag-buttons button {
        font-size: 15px;
        padding: 14px 20px;
    }
    .tmag-logo img {
        max-width: 160px;
        max-height: 80px;
    }
}

@media screen and (max-height: 500px) {
    #tmag-modal {
        padding: 16px;
        min-height: auto;
    }
    .tmag-heading {
        font-size: 18px;
        margin-bottom: 12px;
    }
    .tmag-buttons {
        flex-direction: row;
        gap: 10px;
    }
    .tmag-buttons button {
        padding: 12px 16px;
        font-size: 14px;
    }
    .tmag-logo img {
        max-height: 50px;
    }
    .tmag-disclaimer {
        font-size: 10px;
    }
}

/* ==========================================================
   Body lock when overlay is visible
   ========================================================== */

body.tmag-locked {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    top: 0 !important;
}
