/* --- DREAMABLE UNIFIED BRAND SYSTEM --- */
:root {
    --slate-dark: #1e293b;
    --slate-main: #334155;
    --slate-light: #64748b;
    --blue-main: #3B82F6;
    --blue-hover: #2563EB;
    --blue-light: #eff6ff;
    --amber-main: #F59E0B;
    --bg-color: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 25px rgba(0,0,0,0.05), 0 4px 10px rgba(0,0,0,0.03);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.3);
    --success: #10b981;
    --danger: #ef4444;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--slate-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; 
}

/* Accessibility helper */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* --- WEB COMPONENTS --- */
site-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* --- NAVIGATION --- */
nav {
    background-color: var(--surface);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    gap: 15px;
}

.nav-desktop-links { display: flex; gap: 30px; align-items: center; }
.nav-desktop-links a { text-decoration: none; color: var(--slate-light); font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-desktop-links a:hover { color: var(--blue-main); }
.nav-actions { display: flex; gap: 15px; align-items: center; }

.user-badge {
    display: flex; align-items: center; gap: 8px; background-color: var(--bg-color);
    border: 1px solid var(--border); padding: 8px 14px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 700; color: var(--slate-main); white-space: nowrap;
}

.status-dot { width: 8px; height: 8px; border-radius: 50%; background-color: var(--slate-light); display: inline-block; }
.status-dot.active { background-color: var(--success); box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.status-dot.warning { background-color: var(--amber-main); box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.status-dot.danger { background-color: var(--danger); }

/* --- BUTTONS --- */
.btn, .action-btn { background-color: var(--blue-main); color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: var(--transition); border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); }
.btn:hover, .action-btn:hover:not(:disabled) { background-color: var(--blue-hover); transform: translateY(-2px); box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3); }
.action-btn:disabled { background-color: var(--slate-light); box-shadow: none; cursor: not-allowed; transform: none; }
.action-btn.success { background-color: var(--amber-main); color: var(--slate-dark); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2); }
.action-btn.success:hover { background-color: #d97706; color: white; box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3); }
.btn-outline { background-color: transparent; color: var(--slate-main); border: 2px solid var(--border); box-shadow: none; padding: 10px 22px; border-radius: 8px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; transition: var(--transition); cursor: pointer; }
.btn-outline:hover { background-color: var(--slate-main); color: white; border-color: var(--slate-main); }
.nav-cta { padding: 10px 20px; font-size: 0.95rem; white-space: nowrap; }

/* --- HERO SECTION --- */
.hero { padding: 100px 5%; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; max-width: 1400px; margin: 0 auto; }
.hero h1 { font-size: 3.5rem; font-weight: 900; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 20px; color: var(--slate-dark); }
.hero p { font-size: 1.2rem; color: var(--slate-light); margin-bottom: 30px; max-width: 500px; }
.hero-buttons { display: flex; gap: 15px; }
.hero-graphic { background: var(--surface); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-md); border: 1px solid var(--border); position: relative; overflow: hidden; }
.abstract-line { height: 8px; border-radius: 4px; margin-bottom: 15px; }
.l-blue { background-color: var(--blue-main); width: 60%; }
.l-amber { background-color: var(--amber-main); width: 40%; }
.l-slate { background-color: var(--slate-light); width: 80%; opacity: 0.3;}

/* --- TRUST BANNER --- */
.trust-banner { background-color: var(--slate-dark); color: white; text-align: center; padding: 20px; font-size: 0.9rem; font-weight: 500; letter-spacing: 0.05em; word-spacing: 3px; }
.trust-banner span { color: var(--amber-main); margin: 0 15px; }

/* --- CASE STUDY SECTION --- */
.case-study { background-color: var(--surface); padding: 80px 5%; text-align: center; border-bottom: 1px solid var(--border); }
.case-study-box { max-width: 900px; margin: 0 auto; background: var(--bg-color); padding: 40px; border-radius: var(--radius); border-left: 6px solid var(--amber-main); box-shadow: var(--shadow-sm); }
.case-study h2 { font-size: 2rem; margin-bottom: 15px; color: var(--slate-main); }
.case-study p { font-size: 1.25rem; color: var(--slate-light); font-style: italic; }
.metric { display: block; font-size: 1.1rem; font-weight: 700; color: var(--blue-main); margin-top: 15px; font-style: normal; }
.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 10px; }
.section-header p { color: var(--slate-light); font-size: 1.1rem; max-width: 600px; margin: 0 auto;}

/* --- TOOLS GRID --- */
.tools-section { padding: 100px 5%; max-width: 1400px; margin: 0 auto; }
.tools-grid { display: grid; gap: 30px; width: 100%; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .tools-grid { grid-template-columns: 1fr; } }

.tool-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    width: 100%;
}

.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); border-color: var(--blue-light); }
.tool-icon { width: 50px; height: 50px; background: var(--blue-light); color: var(--blue-main); border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.tool-card h3 { margin-bottom: 10px; font-size: 1.3rem; }
.tool-card p { color: var(--slate-light); margin-bottom: 25px; font-size: 0.95rem; flex-grow: 1;}

.filter-bar { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.filter-btn { background: var(--surface); border: 1px solid var(--border); color: var(--slate-light); padding: 8px 20px; border-radius: 30px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.filter-btn:hover { border-color: var(--blue-light); color: var(--blue-main); }
.filter-btn.active { background: var(--slate-dark); border-color: var(--slate-dark); color: white; }

/* --- PRICING SECTION --- */
.pricing-section { background-color: var(--slate-dark); color: white; padding: 100px 5%; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1200px; margin: 0 auto; }
.price-card { background: var(--slate-main); padding: 40px; border-radius: var(--radius); position: relative; }
.price-card.featured { border: 2px solid var(--amber-main); transform: scale(1.02); }
.featured-badge { position: absolute; top: -15px; right: 30px; background: var(--amber-main); color: var(--slate-dark); padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: 800; }
.price-card h3 { font-size: 1.5rem; margin-bottom: 10px; color: white;}
.price-card .price { font-size: 2.5rem; font-weight: 900; margin-bottom: 20px; color: var(--blue-light);}
.price-card p { color: #cbd5e1; margin-bottom: 20px; font-size: 0.9rem; }
.price-card ul { list-style: none; margin-bottom: 30px; }
.price-card ul li { margin-bottom: 10px; font-size: 0.95rem; color: #f1f5f9; display: flex; align-items: center; gap: 10px;}
.price-card ul li::before { content: "✓"; color: var(--amber-main); font-weight: bold;}

/* --- PORTAL & TOOLS UI ELEMENTS --- */
.portal-container { max-width: 1400px; margin: 40px auto; padding: 0 2%; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; flex-grow: 1; align-items: start; }
.tool-header { text-align: center; margin: 40px 0 30px 0; }
.tool-header h1 { margin: 0 0 10px 0; font-size: 2rem; color: var(--slate-dark); letter-spacing: -0.02em; font-weight: 800; }
.tool-header p { margin: 0; color: var(--slate-light); font-weight: 500; }
.tool-container { max-width: 1200px; margin: 0 auto 60px auto; width: 95%; display: grid; grid-template-columns: 350px 1fr; gap: 30px; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; padding: 30px; justify-content: flex-start; }
.portal-container .panel { padding: 0; }
.panel-header { padding: 30px 40px; border-bottom: 1px solid var(--border); background-color: var(--bg-color); }
.panel-header h2 { font-size: 1.8rem; font-weight: 800; color: var(--slate-dark); margin-bottom: 8px; letter-spacing: -0.02em; }
.panel-header p { color: var(--slate-light); font-size: 0.95rem; font-weight: 500; }
.panel-content { padding: 30px 40px; flex-grow: 1; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; color: var(--slate-main); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-control, input[type="text"], input[type="email"], input[type="password"] { width: 100%; padding: 14px; border: 2px solid var(--border); border-radius: 8px; font-size: 1rem; font-family: 'Inter', sans-serif; transition: var(--transition); background-color: var(--bg-color); color: var(--slate-dark); font-weight: 500; }
.form-control:focus { outline: none; border-color: var(--blue-main); background-color: var(--surface); box-shadow: var(--focus-ring); }
input[type="file"] { display: block; width: 100%; padding: 15px; border: 2px dashed var(--border); border-radius: 8px; cursor: pointer; background: var(--bg-color); color: var(--slate-main); font-weight: 500; transition: var(--transition); }
input[type="file"]:hover { border-color: var(--blue-main); background: var(--blue-light); }

.file-list { list-style: none; padding: 0; margin-bottom: 20px; max-height: 400px; overflow-y: auto;}
.file-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--bg-color); border: 1px solid var(--border); margin-bottom: 8px; border-radius: 8px; font-weight: 500; font-size: 0.9rem;}
.controls button { background: none; border: none; cursor: pointer; color: var(--slate-main); transition: var(--transition); display: inline-flex; padding: 4px; }
.controls button:hover:not(:disabled) { color: var(--blue-main); transform: scale(1.1); }
.controls button:disabled { opacity: 0.3; cursor: not-allowed; }

.tidycal-wrapper { width: 100%; min-height: 500px; border-radius: 8px; overflow: hidden; background: var(--bg-color); }

/* --- MODALS --- */
#paywall-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(30, 41, 59, 0.8); align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); }
.modal-content { background: white; padding: 40px; border-radius: var(--radius); max-width: 420px; text-align: center; box-shadow: var(--shadow-lg); }
.modal-content h2 { color: var(--amber-main); margin-top: 0; font-size: 1.5rem; font-weight: 800;}
.modal-content p { color: var(--slate-light); margin-bottom: 25px; line-height: 1.5; font-weight: 500;}

footer { background-color: var(--surface); padding: 40px 5%; text-align: center; border-top: 1px solid var(--border); color: var(--slate-light); font-size: 0.9rem; margin-top: auto; }

/* STEP Viewer Labels */
.measure-label { position: absolute; background: rgba(30, 41, 59, 0.9); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 700; pointer-events: none; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,0.2); box-shadow: var(--shadow-sm); z-index: 20; }
.measure-label.diameter { background: rgba(245, 158, 11, 0.9); color: #1e293b; border-color: rgba(0,0,0,0.1); }

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .nav-desktop-links { display: none; }
    .portal-container, .tool-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero { grid-template-columns: 1fr; text-align: center; padding: 60px 5%; }
    .hero-buttons { justify-content: center; }
    .hide-mobile { display: none; }
}