@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.main-container {
    max-width: 480px;
    width: 100%;
}

.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

@media (max-width: 600px) {
    body {
        padding: 0;
        background-color: var(--card-bg);
    }
    .main-container {
        max-width: 100%;
        margin: 0;
    }
    .glass-panel {
        border-radius: 0;
        min-height: 100vh;
        border: none;
        box-shadow: none;
        padding: 32px 24px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* Auth Box */
.auth-box {
    text-align: center;
}

.login-illustration {
    width: 100%;
    max-width: 160px;
    height: auto;
    margin: 0 auto 24px auto;
    display: block;
    mix-blend-mode: multiply;
}

.auth-box h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.auth-box p.subtitle {
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    font-size: 15px;
    line-height: 1.5;
}

.auth-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.auth-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.auth-input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.auth-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px #e0e7ff;
}

.auth-btn-main {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.auth-btn-main:hover {
    background-color: var(--primary-hover);
}

.contact-highlight {
    margin-top: 24px;
    color: #b45309;
    font-size: 14px;
    font-weight: 500;
    background: #fef3c7;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
}

.contact-highlight a {
    color: #92400e;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    margin-left: 4px;
    font-weight: 600;
}

/* Dashboard */
.dashboard {
    display: none;
}

.dashboard.visible {
    display: block;
    animation: fadeIn 0.4s ease;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.dashboard-header h2 i {
    color: var(--text-muted);
}

.logout-btn {
    background: #ffffff;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logout-btn:hover {
    background: #f9fafb;
    color: var(--text-primary);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.info-card {
    background: #f9fafb;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.info-card i.bg-icon {
    display: none; /* Hide generic AI background icons */
}

.info-card h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
}

.info-card h4::before {
    /* We can inject small icons here if needed via JS or keep it clean */
}

.info-card p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

/* Specific Info Overrides */
#dispApiKey {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
    color: var(--primary);
}

#dispLimit {
    font-size: 24px;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.status.active { color: #065f46; background-color: #d1fae5; border: 1px solid #a7f3d0; }
.status.expired { color: #991b1b; background-color: #fee2e2; border: 1px solid #fecaca; }

/* Actions */
.action-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.action-section label {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 10px 14px;
    background-color: #ffffff;
    color: var(--text-primary);
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px #e0e7ff;
}

.input-group button {
    padding: 10px 18px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-group button:hover {
    background-color: var(--primary-hover);
}

.input-group button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Results */
#resultBox {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    display: none;
    font-size: 14px;
    line-height: 1.5;
}

.result-success { 
    background: #ecfdf5; 
    color: #065f46; 
    border: 1px solid #a7f3d0; 
}
.result-error { 
    background: #fef2f2; 
    color: #991b1b; 
    border: 1px solid #fecaca; 
}
.result-info { 
    background: #eff6ff; 
    color: #1e40af; 
    border: 1px solid #bfdbfe; 
}

@keyframes fadeIn {
    from { opacity: 0; } 
    to { opacity: 1; }
}

/* FAB Support Button */
.fab-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 12px;
}

.fab-main {
    width: 56px;
    height: 56px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.fab-main:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.fab-options {
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.9);
    transition: all 0.2s ease-out;
    transform-origin: bottom center;
}

.fab-container.open .fab-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fab-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 20px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    transition: transform 0.2s;
    position: relative;
}

.fab-item:hover {
    transform: scale(1.1);
}

.fab-item::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    background: #1f2937;
    color: #f9fafb;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(5px);
    transition: all 0.2s ease;
    pointer-events: none;
}

.fab-item:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.fab-wa { background-color: #10b981; }
.fab-tg { background-color: #3b82f6; }
.fab-ch { background-color: #f97316; }