<style> /* === FONT IMPORT === */
/* Assumes fonts are in /assets/fonts/ */
@font-face {
    font-family: 'SolaimanLipi';
    src: url('../fonts/SolaimanLipi.woff2') format('woff2'),
         url('../fonts/SolaimanLipi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backgroundGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(1px); }
    30%, 50%, 70% { transform: translateX(-2px); }
    40%, 60% { transform: translateX(2px); }
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}


/* === CSS VARIABLES & BASE STYLES === */
:root {
    --font-primary: 'SolaimanLipi', system-ui, -apple-system, sans-serif;
    --font-headline: 'SolaimanLipi', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Menlo', monospace;

    /* Light Theme Colors */
    --text: #0f172a; --text-muted: #64748b; --border: #e2e8f0; --surface: rgba(255, 255, 255, 0.7); --bg: #f8fafc;
    
    /* Brand Colors */
    --brand-base: #D0D2FF;
    --brand-500: #5C67F2; 
    --brand-600: #4f58e8;

    /* Status Colors */
    --ok-bg: #f0fdf4; --ok-border: #bbf7d0; --ok-text: #16a34a;
    --warn-bg: #fffbeb; --warn-border: #fde68a; --warn-text: #d97706;
    --bad-bg: #fef2f2; --bad-border: #fecaca; --bad-text: #dc2626;

    /* Sizing & Effects */
    --header-height: 64px;
    --radius-md: 3px; --radius-lg: 12px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background-color: var(--bg);
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
/* Upgraded background gradient for a more premium feel */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at top left, hsl(235, 100%, 96%), transparent 40%),
                radial-gradient(circle at bottom right, hsl(320, 100%, 96%), transparent 50%);
    background-color: #f7f9fc; /* Soft base background */
    animation: backgroundGradient 30s ease-in-out infinite;
    z-index: -1;
}

/* === ACCESSIBILITY === */
:focus-visible {
    outline: 3px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 2px;
}
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}

/* === DARK THEME === */
@media (prefers-color-scheme: dark) {
    :root {
        --text: #e2e8f0; --text-muted: #94a3b8; --border: #334155; --surface: rgba(30, 41, 59, 0.7); --bg: #0f172a;
        --ok-bg: #112d19; --ok-border: #154b25; --ok-text: #4ade80;
        --warn-bg: #36290b; --warn-border: #64450f; --warn-text: #facc15;
        --bad-bg: #3f1212; --bad-border: #7f1d1d; --bad-text: #f87171;
    }
    body::before { display: none; }
    .app-header { background-color: rgba(15, 23, 42, 0.8); }
    .btn.btn-wa { background-color: #16653433; border-color: #14532d; color: #4ade80; }
    .btn.btn-fb { background-color: #1e40af33; border-color: #1e3a8a; color: #93c5fd; }
}

/* === UTILITY CLASSES === */
.hidden { display: none !important; }

/* === LAYOUT: HEADER (Glassmorphism Effect) === */
.app-header {
    position: sticky; top: 0; z-index: 10;
    background-color: var(--surface);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-row {
    max-width: 1280px; margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 2rem);
    display: flex; align-items: center; justify-content: space-between;
    height: var(--header-height);
}
.brand img { height: 32px; object-fit: contain; }
.status-display { display: flex; align-items: center; gap: 1rem; }

/* === LAYOUT: MAIN CONTENT === */
.page-container {
    min-height: calc(100vh - var(--header-height));
    padding: clamp(1rem, 5vw, 2rem);
    display: grid;
    place-items: center;
}
.view { animation: fadeIn 0.6s var(--transition) forwards; }

/* === Upgraded Card with Glassmorphism Effect === */
.card {
    width: 100%; max-width: 420px;
    background-color: var(--surface);
    border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 6vw, 2.5rem);
    box-shadow: var(--shadow-premium);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

/* === COMPONENTS: CHIP === */
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background-color: var(--bg); /* Use solid bg for chip readability */
    transition: all var(--transition);
}
.chip.ok { border-color: var(--ok-border); background-color: var(--ok-bg); color: var(--ok-text); }
.chip.warn { border-color: var(--warn-border); background-color: var(--warn-bg); color: var(--warn-text); }
.chip.bad { border-color: var(--bad-border); background-color: var(--bad-bg); color: var(--bad-text); }
.chip .icon { width: 16px; height: 16px; }

/* === COMPONENTS: BUTTONS (Polished Hover Effects) === */
.btn, .btn-mini {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; font-family: var(--font-primary);
    border-radius: var(--radius-md);
    font-weight: 700; text-decoration: none;
    cursor: pointer; transition: all var(--transition);
    border: 1px solid var(--border);
    background-color: var(--bg); /* Use solid bg for button readability */
    color: var(--text);
}
.btn-mini { font-size: 14px; padding: 8px 14px; }
.btn { font-size: 15px; padding: 12px 20px; }

.btn:hover:not([disabled]), .btn-mini:hover:not([disabled]) {
    transform: translateY(-2px) scale(1.02); /* Added scale for better feedback */
    box-shadow: var(--shadow-md);
    border-color: var(--text-muted);
}
.btn:active:not([disabled]), .btn-mini:active:not([disabled]) {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm);
}
.btn[disabled], .btn-mini[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: color-mix(in srgb, var(--brand-500) 15%, transparent);
    /* KEY CHANGE: Using a much darker, accessible brand color for text */
    color: #4338CA; 
    border: 1px solid color-mix(in srgb, var(--brand-500) 35%, transparent);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover:not([disabled]) {
    background-color: color-mix(in srgb, var(--brand-500) 22%, transparent);
    border-color: color-mix(in srgb, var(--brand-500) 50%, transparent);
    color: #3730A3; /* Darker on hover for effect */
    box-shadow: var(--shadow-md);
}



.btn-icon { padding: 10px 16px; border-radius: 999px; }
.btn-wa { background-color: #25d3661a; border-color: #abfadd; color: #059669; }
.btn-fb { background-color: #1877f21a; border-color: #bfdbfe; color: #1d4ed8; }
.btn-retry { background-color: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }
.btn .icon, .btn-mini .icon { width: 20px; height: 20px; }

.spinner { animation: rotate 1.5s linear infinite; width: 20px; height: 20px; }
.spinner .path { stroke: #fff; stroke-linecap: round; animation: dash 1.2s ease-in-out infinite; }

/* === COMPONENTS: FORM & INPUT === */
.license-form, .status-content {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; gap: 1.5rem;
}
.form-header, .form-group { width: 100%; display: flex; flex-direction: column; gap: 0.5rem; }
.icon-badge {
    width: 72px; height: 72px;
    display: grid; place-items: center;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius-lg); margin: 0 auto;
}
.icon-badge img { width: 44px; height: 44px; }
.form-title {
    font-family: var(--font-headline); font-weight: 700;
    font-size: clamp(1.5rem, 5vw, 1.75rem);
    margin: 0; letter-spacing: -0.5px;
}
.form-subtitle { font-size: 1rem; color: var(--text-muted); margin: -0.75rem 0 0; }

.key-input-wrapper { position: relative; width: 100%; max-width: 380px; margin: 0 auto; }
.key-input-real {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; border: none; background: transparent;
    font-size: 1px; color: transparent; caret-color: var(--brand-500);
    z-index: 2; padding-left: 12px;
    letter-spacing: 38px;
}
/* CORE FIX: Changed from Flex to Grid for true responsiveness */
.key-boxes {
    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 8 equal columns */
    gap: 8px;
    cursor: text;
}
/* CORE FIX: Removed fixed width/height, using aspect-ratio for flexible shape */
.key-boxes span {
    display: grid; place-items: center;
    aspect-ratio: 4 / 5; /* Maintain shape without fixed height */
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    font-family: var(--font-mono); font-size: clamp(1rem, 5vw, 1.5rem); /* Responsive font size */
    font-weight: 700;
    transition: all var(--transition);
}
/* Upgraded focus state for a premium look */
.key-input-real:focus + .key-boxes span.is-active {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 30%, transparent);
}
.key-boxes span.has-value { border-color: var(--brand-600); }
.key-input-wrapper.input-error { animation: shake 0.6s ease-in-out; }
.key-input-wrapper.input-error .key-boxes span { border-color: var(--bad-text); }

.form-options { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.form-hint { color: var(--bad-text); font-size: 14px; min-height: 20px; transition: all var(--transition); }

/* === COMPONENTS: CTA & STATUS VIEW === */
.support-cta { margin-top: 1rem; }
.cta-hint { font-size: 15px; color: var(--text-muted); margin: 0 0 0.75rem; }
.cta-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.status-title { font-size: 1.5rem; font-family: var(--font-headline); margin: 0; }
.status-message { font-size: 1rem; color: var(--text-muted); margin: -1rem 0 0; }
.key-details { display: flex; align-items: center; gap: 0.75rem; }
.mono-display {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); background-color: var(--bg);
    border: 1px solid var(--border); padding: 8px 14px;
    border-radius: var(--radius-md); font-size: 14px; font-weight: 700;
}
.status-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.expiry-date { background-color: var(--warn-bg); border-color: var(--warn-border); color: var(--warn-text); }

/* === IFRAME === */
.fullframe {
    position: fixed; inset: 0; top: var(--header-height);
    width: 100%; height: calc(100vh - var(--header-height));
    border: 0; background-color: var(--bg);
}

/* NOTE: The media query for small screens is no longer needed for the key boxes 
  because the new Grid layout is naturally responsive. It has been removed.
*/


/* === USER MENU DROPDOWN STYLES === */
.user-menu-wrapper {
    position: relative;
    z-index: 20; /* হেডার এর উপরে থাকবে */
}

#userMenuToggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
}

#userMenuToggle .icon {
    width: 16px;
    height: 16px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: fadeIn 0.3s var(--transition);
    
    /* গ্লাস ইফেক্ট */
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.menu-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 0 0.25rem;
}
.menu-info-item .info-label {
    color: var(--text-muted);
}
.menu-info-item .info-value {
    font-family: var(--font-mono);
    font-weight: 700;
}

.menu-divider {
    height: 1px;
    background-color: var(--border);
    margin: 0.25rem 0;
}

.btn-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    background-color: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-menu-item .icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}
.btn-menu-item:hover {
    background-color: color-mix(in srgb, var(--brand-500) 15%, transparent);
    color: var(--brand-600);
}
/* ডার্ক মোডে হোভার কালার অ্যাডজাস্টমেন্ট */
@media (prefers-color-scheme: dark) {
    .btn-menu-item:hover {
        color: var(--brand-base);
    }
}

 </style>