/* A.R.M.O.R. Sovereign Portal — Self-Hosted Styles */
/* Replaces Tailwind CDN with minimal, self-contained CSS */

/* ========== CSS Reset & Base ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0a0a0f;
    color: #f3f4f6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: 100%;
    color: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* ========== Color Variables ========== */
:root {
    --armor-900: #0a0a0f;
    --armor-800: #111827;
    --armor-700: #1f2937;
    --armor-600: #374151;
    --armor-accent: #3b82f6;
    --armor-success: #10b981;
    --armor-warning: #f59e0b;
    --armor-danger: #ef4444;
}

/* ========== Layout Utilities ========== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-grow { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-8 > * + * { margin-left: 2rem; }

/* ========== Spacing ========== */
.m-0 { margin: 0; }
.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.pb-6 { padding-bottom: 1.5rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-20 { padding-bottom: 5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1_5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.p-12 { padding: 3rem; }

/* ========== Sizing ========== */
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-full { width: 100%; }
.w-1_3 { width: 33.333333%; }

.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-2 { height: 0.5rem; }
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-md { max-width: 28rem; }

/* ========== Typography ========== */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.tracking-tight { letter-spacing: -0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

.uppercase { text-transform: uppercase; }

.text-center { text-align: center; }
.text-left { text-align: left; }

.leading-relaxed { line-height: 1.625; }

/* ========== Colors ========== */
.text-white { color: #ffffff; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }

.text-armor-accent { color: var(--armor-accent); }
.text-armor-success { color: var(--armor-success); }
.text-armor-warning { color: var(--armor-warning); }
.text-armor-danger { color: var(--armor-danger); }

.bg-armor-900 { background-color: var(--armor-900); }
.bg-armor-800 { background-color: var(--armor-800); }
.bg-armor-700 { background-color: var(--armor-700); }
.bg-armor-600 { background-color: var(--armor-600); }
.bg-armor-accent { background-color: var(--armor-accent); }
.bg-armor-success { background-color: var(--armor-success); }
.bg-armor-warning { background-color: var(--armor-warning); }
.bg-armor-danger { background-color: var(--armor-danger); }

.bg-gray-700 { background-color: #374151; }

.bg-armor-accent-10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-armor-accent-20 { background-color: rgba(59, 130, 246, 0.2); }
.bg-armor-success-10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-armor-success-20 { background-color: rgba(16, 185, 129, 0.2); }
.bg-armor-warning-10 { background-color: rgba(245, 158, 11, 0.1); }
.bg-armor-warning-20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-armor-danger-10 { background-color: rgba(239, 68, 68, 0.1); }
.bg-armor-danger-20 { background-color: rgba(239, 68, 68, 0.2); }

.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.border-gray-800 { border-color: #1f2937; }
.border-armor-accent-30 { border-color: rgba(59, 130, 246, 0.3); }
.border-armor-success-30 { border-color: rgba(16, 185, 129, 0.3); }
.border-armor-warning-30 { border-color: rgba(245, 158, 11, 0.3); }
.border-armor-danger-30 { border-color: rgba(239, 68, 68, 0.3); }

/* ========== Borders ========== */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* ========== Effects ========== */
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }
.shadow-black-50 { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); }

.backdrop-blur-md { backdrop-filter: blur(12px); }

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-60 { opacity: 0.6; }
.opacity-70 { opacity: 0.7; }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.whitespace-nowrap { white-space: nowrap; }
.break-all { word-break: break-all; }

/* ========== Position ========== */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.z-50 { z-index: 50; }

/* ========== Transitions ========== */
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 150ms; }
.transition-all { transition-property: all; transition-duration: 150ms; }

.hover\:text-white:hover { color: #ffffff; }
.hover\:bg-gray-600:hover { background-color: #4b5563; }
.hover\:bg-armor-700:hover { background-color: #1f2937; }
.hover\:bg-blue-600:hover { background-color: #2563eb; }
.hover\:bg-armor-accent-30:hover { background-color: rgba(59, 130, 246, 0.3); }
.hover\:bg-armor-success-30:hover { background-color: rgba(16, 185, 129, 0.3); }
.hover\:bg-armor-warning-30:hover { background-color: rgba(245, 158, 11, 0.3); }
.hover\:bg-armor-danger-30:hover { background-color: rgba(239, 68, 68, 0.3); }
.hover\:underline:hover { text-decoration: underline; }
.hover\:border-armor-success:hover { border-color: var(--armor-success); }

.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--ring-color, var(--armor-accent)); }
.focus\:border-transparent:focus { border-color: transparent; }

/* ========== Custom Scrollbar ========== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0f; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #4b5563; }

/* ========== Form Autofill Fix ========== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #f3f4f6;
    -webkit-box-shadow: 0 0 0px 1000px #111827 inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ========== Selection ========== */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
}

*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

main { animation: fadeIn 0.3s ease-in-out; }

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

.signal-verified-pulse { animation: pulse-green 2s infinite; }

@keyframes ghost-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.ghost-pulse { animation: ghost-pulse 4s ease-in-out infinite; }

@keyframes sector-glow {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(59, 130, 246, 0.3)); }
    50% { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6)); }
}

.sector-glow { animation: sector-glow 3s ease-in-out infinite; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.float-animation { animation: float 6s ease-in-out infinite; }

/* ========== Validation ========== */
.field-validation-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.input-validation-error {
    border-color: #ef4444 !important;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2) !important;
}

/* ========== Table ========== */
table tbody tr { transition: background-color 0.15s ease; }

/* ========== Hidden / Display ========== */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }

/* ========== Responsive ========== */
@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
    .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .sm\:py-8 { padding-top: 2rem; padding-bottom: 2rem; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:mt-0 { margin-top: 0; }
    .sm\:text-5xl { font-size: 3rem; }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:col-span-2 { grid-column: span 2 / span 2; }
    .sm\:p-8 { padding: 2rem; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; }
    .md\:mt-0 { margin-top: 0; }
    .md\:block { display: block; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ========== Landing Page Specific ========== */
.landing-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.sector-map {
    width: 100%;
    max-width: 600px;
    position: relative;
}

.sector-map svg {
    width: 100%;
    height: auto;
}

.sector-path {
    fill: rgba(31, 41, 55, 0.8);
    stroke: rgba(59, 130, 246, 0.4);
    stroke-width: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sector-path:hover {
    fill: rgba(59, 130, 246, 0.2);
    stroke: rgba(59, 130, 246, 0.8);
    stroke-width: 2;
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.5));
}

.sector-label {
    fill: #d1d5db;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    transition: fill 0.3s ease;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.02em;
}

.sector-path:hover + .sector-label,
.sector-path:hover ~ .sector-label {
    fill: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 8px rgba(59, 130, 246, 0.4);
}

.center-circle {
    fill: var(--armor-900);
    stroke: rgba(59, 130, 246, 0.6);
    stroke-width: 2;
}

.center-text {
    font-size: 14px;
    font-weight: 700;
    fill: #ffffff;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* ========== FAQ Accordion ========== */
.faq-item {
    border: 1px solid #374151;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: var(--armor-800);
    margin-bottom: 1rem;
}

.faq-question {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: #f3f4f6;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.faq-question:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.5rem;
}

.faq-answer.open {
    max-height: 500px;
    padding: 0 1.5rem 1.5rem;
}

.faq-icon {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

/* ========== Protocol Cards ========== */
.protocol-card {
    background-color: var(--armor-800);
    border: 1px solid #374151;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.protocol-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.protocol-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: rgba(59, 130, 246, 0.2);
    color: var(--armor-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ========== Access Key Page ========== */
.access-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.key-display {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    background-color: var(--armor-900);
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1rem;
    word-break: break-all;
    font-size: 0.875rem;
    color: var(--armor-accent);
}

/* ========== Gradient Utilities ========== */
.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.from-armor-accent-10 { --tw-gradient-from: rgba(59, 130, 246, 0.1); --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to); }
.to-armor-success-10 { --tw-gradient-to: rgba(16, 185, 129, 0.1); }

.via-transparent { --tw-gradient-stops: var(--tw-gradient-from), transparent, var(--tw-gradient-to); }
