*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { margin: 0; padding: 0; }

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    min-height: 100vh;
    padding: 0;
    padding-bottom: 90px;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--green);
    border-radius: 50%;
    animation: pulse 2s infinite;
    display: inline-block;
}

/* Container */
.container {
    max-width: 100%;
    padding: 0 1rem;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

/* Header */
.header {
    background: var(--bg-header);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
    width: 100%;
    padding: 0 1rem;
}
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    width: 100%;
}
.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.shield-icon {
    width: 32px;
    height: 40px;
    background: var(--grad-gold-deep);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    flex-shrink: 0;
}
.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
}
.header-subtitle {
    font-size: 0.7rem;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.menu-btn {
    background: none;
    border: 1px solid var(--border-gold);
    color: var(--text-primary);
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    backdrop-filter: var(--blur);
}
.menu-btn:hover { background: var(--bg-card); }

/* Page titles */
.page-title {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0.25rem;
    color: var(--green-heading);
}
.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* View switching */
.view { display: none; animation: slideUp 0.25s ease; }
.view.active { display: block; }

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.badge-secure { background: rgba(74, 222, 128, 0.15); color: var(--green); border: 1px solid rgba(74, 222, 128, 0.3); }
.badge-pqc { background: rgba(201, 149, 108, 0.15); color: var(--gold); border: 1px solid rgba(201, 149, 108, 0.3); }
.badge-warn { background: rgba(245, 158, 11, 0.15); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--grad-gold-deep);
    color: white;
}
.btn-primary:hover { filter: brightness(1.1); box-shadow: var(--shadow-gold); }
.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-white);
}
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-block { width: 100%; justify-content: center; }

/* Form elements */
input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-white);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--gold);
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}
select { appearance: none; cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }

/* Utility */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-lg { gap: 1rem; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-md { margin-bottom: 0.75rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mt-md { margin-top: 0.75rem; }
.text-sm { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.mono { font-family: 'SF Mono', 'Fira Code', monospace; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-gold); border-radius: 4px; }

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}
.toast {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border-gold);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}
.toast-info { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.3); }
.toast-success { background: rgba(74, 222, 128, 0.15); border-color: rgba(74, 222, 128, 0.3); }
.toast-error { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.3); }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    margin-left: auto;
    font-size: 1rem;
}
