:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 1rem;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Base Header & Footer (Auth Pages) */
header, footer {
    padding: 1rem 2rem;
    text-align: center;
}

/* Logo Styling */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 1.5rem;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: var(--primary);
    color: white;
    border-radius: 6px;
    font-weight: 900;
    font-size: 1.25rem;
}

.logo-text {
    letter-spacing: -0.02em;
}

/* Dashboard/Detail Header overrides */
.dashboard header, .detail-page header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: left;
}

/* Dashboard/Detail Footer overrides */
.dashboard footer, .detail-page footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: auto;
}

main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 1rem;
}

/* Dashboard/Detail Main overrides */
.dashboard main, .detail-page main {
    display: block;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Auth Sections (Login/Signup/Recovery) */
section#login-section, 
section#signup-section, 
section#recovery-section {
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.875rem;
}

fieldset {
    border: none;
    margin-bottom: 1.5rem;
}

legend {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

p {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--primary-hover);
}

nav ul {
    list-style: none;
}

/* Auth Navigation */
section nav ul {
    margin-top: 1.5rem;
    font-size: 0.875rem;
    text-align: center;
}

section nav li {
    margin-bottom: 0.5rem;
}

/* Dashboard Navigation */
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

header nav ul {
    display: flex;
    gap: 1.5rem;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Dashboard Grid */
#features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 2rem;
}

@media (min-width: 1024px) {
    #features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dashboard Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    display: grid;
    gap: .75rem;
}

.card:hover, .card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card a {
    display: block;
    padding: 2rem;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.card footer {
    padding: 0;
    background: transparent;
    border: none;
    text-align: left;
    font-weight: 600;
}

/* Detail View */
.detail-page article {
    background: var(--surface);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 480px) {
    section#login-section, 
    section#signup-section, 
    section#recovery-section {
        padding: 1.5rem;
        box-shadow: none;
        border-radius: 0;
        background: transparent;
    }
}
