@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-base: #0b0d19;
    --bg-surface: rgba(18, 22, 45, 0.65);
    --bg-surface-solid: #12162d;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-active: rgba(0, 242, 254, 0.5);
    
    --primary: #00f2fe;
    --primary-glow: rgba(0, 242, 254, 0.15);
    --primary-hover: #4facfe;
    --secondary: #7f00ff;
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-disabled: #64748b;
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.15);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 10% 20%, rgba(127, 0, 255, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(0, 242, 254, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(15, 23, 42, 0.95) 0px, var(--bg-base) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}
a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Glassmorphic Container */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 2.5rem;
    transition: var(--transition-smooth);
}
.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Header & Navigation */
.app-header {
    background: rgba(11, 13, 25, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.app-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.app-logo svg {
    stroke: #00f2fe;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}
.nav-link.active, .nav-link:hover {
    color: var(--text-primary);
}

/* Auth Pages & Form Controls */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem;
}
.auth-card {
    max-width: 500px;
    width: 100%;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
    transition: var(--transition-smooth);
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(15, 23, 42, 0.8);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #0b0d19;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.5);
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f43f5e);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}

/* Tabs switcher for login channel selector */
.tab-selector {
    display: flex;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}
.tab-btn {
    flex: 1;
    text-align: center;
    padding: 0.625rem;
    font-size: 0.85rem;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.tab-btn.active {
    background: var(--bg-surface-solid);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Workflow Container Layout */
.workflow-container {
    max-width: 900px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Step/Phase Indicators */
.step-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    padding: 0 0.5rem;
}
.step-tracker-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 1;
    transform: translateY(-50%);
}
.step-tracker-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    z-index: 2;
    transform: translateY(-50%);
    transition: width 0.5s ease;
}
.step-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-base);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 3;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}
.step-node.active {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}
.step-node.completed {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    border-color: transparent;
    color: #0b0d19;
}

/* Phase 2: Family Hub Cards */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}
.profile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}
.profile-card:hover {
    background: rgba(0, 242, 254, 0.03);
    border-color: var(--border-color-active);
    transform: translateY(-3px);
}
.profile-card.active {
    background: rgba(127, 0, 255, 0.08);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(127, 0, 255, 0.2);
}
.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}
.profile-card.active .profile-avatar {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #0b0d19;
}
.profile-name {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}
.profile-relation {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.profile-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.65rem;
    background: rgba(0, 242, 254, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Phase 3: High Liability Banner */
.high-liability-badge {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.high-liability-icon {
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

/* Order Summary Box */
.order-summary {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}
.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.order-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.order-item-name {
    font-weight: 500;
}
.order-item-code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    margin-left: 0.5rem;
}
.order-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.15rem;
    font-weight: 700;
}

/* Phase 4: Consent & Disclosures */
.disclosure-scroll-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: 250px;
    overflow-y: auto;
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}
.disclosure-scroll-box h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}
.disclosure-scroll-box p {
    margin-bottom: 1rem;
}
.disclosure-scroll-box p:last-child {
    margin-bottom: 0;
}
.consent-checkbox-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    line-height: 1.4;
}
.checkbox-container input {
    margin-top: 3px;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

/* Phase 5: Digital Signature Pad */
.signature-section {
    margin-bottom: 2rem;
}
.signature-canvas-wrapper {
    background: #0f172a;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    touch-action: none;
}
.signature-canvas-wrapper.active {
    border-color: var(--primary);
}
.signature-pad-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}
.signature-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.signature-hash-indicator {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--primary);
    opacity: 0.8;
}

/* Phase 6 & 7: Camera captures & scanning */
.media-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (min-width: 640px) {
    .media-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.camera-card {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}
.camera-preview-container {
    width: 100%;
    height: 180px;
    background: #090d16;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}
.camera-preview-container video, .camera-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(9, 13, 22, 0.85);
    color: var(--text-muted);
    font-size: 0.85rem;
    gap: 0.5rem;
    z-index: 10;
    transition: var(--transition-smooth);
}
.camera-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
.camera-status-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 15;
}
.camera-status-pill.success {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}
.camera-status-pill.encrypted {
    color: var(--primary);
    border-color: rgba(0, 242, 254, 0.3);
}
.camera-status-pill.warning {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}
.camera-btn-row {
    display: flex;
    gap: 0.5rem;
}
.camera-shutter {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(255,255,255,0.3);
    cursor: pointer;
    transition: var(--transition-smooth);
}
.camera-shutter:hover {
    transform: scale(1.1);
    background: var(--primary);
}

/* Phase 8: Hard Session Purge Overlay */
.purge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 9, 21, 0.98);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.purge-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.purge-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
}

/* Admin Dashboard & Exception lists */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 3fr 1fr;
    }
}
.table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}
.admin-table th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 0.875rem 1rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}
.badge-drawn {
    background: rgba(127, 0, 255, 0.15);
    color: #a78bfa;
}
.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}
