/**
 * AgeSentry - Modern UI
 */

:root {
    --age_sentry-bg-overlay: rgba(10, 10, 12, 0.85);
    --age_sentry-bg-popup: #1a1b20;
    --age_sentry-text-main: #ffffff;
    --age_sentry-text-muted: #9ca3af;
    --age_sentry-primary: #10b981; /* Emerald Green */
    --age_sentry-primary-hover: #059669;
    --age_sentry-border: #374151;
    --age_sentry-border-light: rgba(255, 255, 255, 0.1);
    --age_sentry-danger: #ef4444;
    --age_sentry-input-bg: #272831;
    --age_sentry-radius-popup: 24px;
    --age_sentry-radius-btn: 12px;
}

/* Overlay & Animations */
#age_sentry-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--age_sentry-bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    padding: 20px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#age_sentry-overlay.age_sentry-show {
    opacity: 1;
    visibility: visible;
}

#age_sentry-overlay.age_sentry-hiding {
    opacity: 0;
}

/* Popup Container */
#age_sentry-popup {
    background: var(--age_sentry-bg-popup);
    border: 1px solid var(--age_sentry-border-light);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.05);
    border-radius: var(--age_sentry-radius-popup);
    width: 100%;
    max-width: 440px;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

#age_sentry-overlay.age_sentry-show #age_sentry-popup {
    transform: translateY(0) scale(1);
}

.age_sentry-popup-inner {
    padding: 40px 32px;
    text-align: center;
}

/* Logo */
.age_sentry-logo-wrapper {
    margin-bottom: 24px;
}
.age_sentry-logo {
    max-width: 140px;
    max-height: 80px;
    object-fit: contain;
}

/* Typography */
.age_sentry-title {
    color: var(--age_sentry-text-main) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.3 !important;
}

.age_sentry-subtitle {
    color: var(--age_sentry-text-muted) !important;
    font-size: 15px !important;
    margin: 0 0 30px 0 !important;
    line-height: 1.5 !important;
}

/* Buttons */
.age_sentry-btn-group {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.age_sentry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--age_sentry-radius-btn);
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
    font-family: inherit;
    flex: 1;
}

.age_sentry-btn-block {
    width: 100%;
}

.age_sentry-btn-primary {
    background: var(--age_sentry-primary);
    color: #fff !important;
    border: none;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.age_sentry-btn-primary:hover {
    background: var(--age_sentry-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.age_sentry-btn-outline {
    background: transparent;
    color: var(--age_sentry-text-main) !important;
    border: 2px solid var(--age_sentry-border);
}

.age_sentry-btn-outline:hover {
    border-color: var(--age_sentry-text-muted);
    background: rgba(255,255,255,0.05);
}

/* Divider */
.age_sentry-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--age_sentry-text-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

.age_sentry-divider::before,
.age_sentry-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--age_sentry-border);
}

.age_sentry-divider span {
    padding: 0 15px;
}

/* Date of Birth Input */
.age_sentry-dob-wrapper {
    margin-bottom: 20px;
}

.age_sentry-input-group {
    position: relative;
    margin-bottom: 12px;
}

.age_sentry-calendar-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--age_sentry-text-muted);
    pointer-events: none;
}

.age_sentry-input {
    width: 100%;
    padding: 16px 16px 16px 46px !important;
    font-size: 16px !important;
    border-radius: var(--age_sentry-radius-btn) !important;
    border: 2px solid var(--age_sentry-border) !important;
    background: var(--age_sentry-input-bg) !important;
    color: var(--age_sentry-text-main) !important;
    outline: none !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    font-family: inherit !important;
    text-align: left !important;
    cursor: pointer;
}

.age_sentry-input::placeholder {
    color: var(--age_sentry-text-muted);
}

.age_sentry-input:focus, .age_sentry-input.active {
    border-color: var(--age_sentry-primary) !important;
    background: var(--age_sentry-bg-popup) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1) !important;
}

/* Remember Me Checkbox */
.age_sentry-remember-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 8px;
    color: var(--age_sentry-text-muted) !important; /* !important fixes theme overrides */
    font-size: 14px !important;
    font-weight: 400 !important;
    cursor: pointer;
    user-select: none;
}

.age_sentry-remember-wrapper input[type="checkbox"] {
    accent-color: var(--age_sentry-primary);
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0 !important;
}

/* Error Message */
.age_sentry-error-message {
    color: var(--age_sentry-danger);
    font-size: 14px;
    margin-top: 10px;
    display: none;
    font-weight: 500;
    animation: age_sentryShake 0.4s ease-in-out;
}

@keyframes age_sentryShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Warning Footer */
.age_sentry-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 25px 0 0 0;
    font-size: 12px !important;
    color: var(--age_sentry-text-muted) !important;
    background: rgba(255,255,255,0.03);
    padding: 12px;
    border-radius: 8px;
    line-height: 1.4;
}

/* Flatpickr Modern Overrides */
.flatpickr-calendar {
    background: var(--age_sentry-input-bg) !important;
    border: 1px solid var(--age_sentry-border) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
    border-radius: 16px !important;
    padding: 5px !important;
    z-index: 9999999 !important; 
}
.flatpickr-months .flatpickr-month, 
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--age_sentry-text-main) !important;
}
span.flatpickr-weekday {
    color: var(--age_sentry-text-muted) !important;
}
.flatpickr-day {
    color: var(--age_sentry-text-main) !important;
    border-radius: 8px !important;
}
.flatpickr-day:hover {
    background: var(--age_sentry-border) !important;
}
.flatpickr-day.selected {
    background: var(--age_sentry-primary) !important;
    border-color: var(--age_sentry-primary) !important;
    color: #fff !important;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 480px) {
    .age_sentry-popup-inner {
        padding: 30px 20px;
    }
    .age_sentry-btn-group {
        flex-direction: column;
    }
    .age_sentry-title {
        font-size: 22px !important;
    }
}