:root {
    --primary: #0d9488; /* Teal 600 */
    --primary-hover: #0f766e; /* Teal 700 */
    --bg-color: #cbd5e1; /* Slate 300 - twice as dark as before */
    --text-main: #1e293b; /* Slate 800 */
    --text-light: #64748b; /* Slate 500 */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow: 0 10px 30px rgba(13, 148, 136, 0.1);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background aesthetic shapes */
.bg-shapes {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}
.shape {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    border-radius: 50%;
}
.shape-1 {
    width: 400px; height: 400px;
    background: #5eead4; /* Teal 300 for contrast */
    top: -100px; left: -100px;
    animation: float 10s infinite alternate;
}
.shape-2 {
    width: 500px; height: 500px;
    background: #99f6e4; /* Teal 200 for contrast */
    bottom: -150px; right: -100px;
    animation: float 12s infinite alternate-reverse;
}
@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 30px); }
}

/* Glassmorphism */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

/* Layout */
#app {
    width: 100%;
    max-width: 1900px;
    padding: 20px;
}

/* Auth Cards */
.auth-card {
    max-width: 400px;
    margin: 40px auto;
    padding: 40px;
}
.auth-card h2 {
    margin-bottom: 24px;
    text-align: center;
    color: var(--primary);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}
input[type="text"], input[type="password"], input[type="tel"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    outline: none;
    transition: var(--transition);
}
input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.checkbox-group label {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn.primary {
    background: var(--primary);
    color: white;
}
.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}
.btn.secondary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn.secondary:hover {
    background: var(--bg-color);
}

.switch-auth {
    text-align: center;
    margin-top: 16px;
    font-size: 0.9rem;
}
.switch-auth a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
}

/* Dashboard */
.dashboard, .admin-dashboard {
    padding: 40px;
}
.admin-dashboard {
    max-width: 1900px !important;
    width: 98vw !important;
}
.admin-user-card:hover {
    border-color: var(--primary) !important;
    background: #f0fdfa !important;
}
.admin-user-card.active {
    border-color: var(--primary) !important;
    background: #f0fdfa !important;
    box-shadow: 0 0 0 2px var(--primary) !important;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 20px;
}
header h2 {
    color: var(--primary);
}
header .btn {
    width: auto;
    padding: 8px 24px;
}

.tests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.test-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(255,255,255,0.75));
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 0 var(--primary), 0 8px 15px rgba(0,0,0,0.1);
    transform: translateY(0);
    display: flex;
    flex-direction: column;
}
.test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 var(--primary), 0 12px 20px rgba(0,0,0,0.15);
}
.test-card:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 var(--primary), 0 2px 5px rgba(0,0,0,0.1);
}
.test-card h3 {
    margin-bottom: 10px;
    font-size: 1.15rem;
    color: var(--text-main);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}
.test-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Tables */
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}
th th {
    font-weight: 600;
    color: var(--primary);
}

/* Progress Charts UI */
.charts-container {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.section-title {
    text-align: center;
    background: #f1f5f9;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    color: var(--text-main);
}
.chart-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}
.chart-label {
    width: 250px;
    text-align: right;
    padding-right: 15px;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
}
.chart-bar-area {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.chart-bar-bg {
    height: 24px;
    background: #e2e8f0;
    width: 100%;
}
.chart-bar-fill {
    height: 100%;
    background: var(--primary);
}
.chart-ranges {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 2px;
}
.chart-score {
    width: 40px;
    text-align: right;
    font-weight: 700;
    padding-left: 10px;
}

/* Interpretation */
.interp-section {
    background: white;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
}
.interp-list {
    margin-top: 10px;
    padding-left: 20px;
}
.interp-list li {
    margin-bottom: 8px;
}

/* Blank Table */
.blank-container {
    margin-top: 10px;
}
.blank-toggle {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-main);
}
.blank-content {
    display: none;
    margin-top: 10px;
    background: white;
    padding: 15px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow-x: auto;
}
.blank-content.open {
    display: block;
}
.blank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.blank-table th, .blank-table td {
    border: 1px solid #e2e8f0;
    padding: 6px;
    text-align: left;
}
.blank-table th {
    background: #f8fafc;
}
.fallback-results {
    font-size: 0.95rem;
    line-height: 1.6;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}
