/* ============================================
   ddot.build Portal -- Dark Mode Stylesheet
   ============================================ */

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

:root {
    --bg-deep: #07080c;
    --bg-surface: #0a0c12;
    --bg-card: #0d0f17;
    --bg-input: #111320;
    --border-subtle: rgba(99, 102, 241, 0.12);
    --border-card: rgba(99, 102, 241, 0.15);
    --border-focus: rgba(99, 102, 241, 0.5);
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.2);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --success-border: rgba(16, 185, 129, 0.2);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 200ms ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ---- Ambient Glow ---- */

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.ambient-glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.ambient-glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
}

/* ---- Navigation ---- */

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(7, 8, 12, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-symbol {
    color: var(--accent);
    font-weight: 700;
}

.brand-dot {
    color: var(--accent-light);
}

.brand-ext {
    color: var(--text-muted);
    font-weight: 400;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-user {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.nav-logout {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    transition: all var(--transition);
}

.nav-logout:hover {
    color: var(--text-secondary);
    border-color: var(--border-card);
    background: rgba(99, 102, 241, 0.05);
}

/* ---- Main Content ---- */

.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* ---- Flash Messages ---- */

.flash-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem 1.5rem 0;
}

.nav-bar ~ .main-content .flash-container {
    max-width: 1200px;
    padding-top: calc(80px + 1rem);
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.flash-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error);
}

.flash-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success);
}

.flash-info {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--accent-light);
}

/* ---- Auth Pages ---- */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    position: relative;
    box-shadow:
        0 0 0 1px rgba(99, 102, 241, 0.05),
        0 8px 40px rgba(0, 0, 0, 0.4),
        0 0 80px rgba(99, 102, 241, 0.03);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo-img {
    height: 100px;
    width: auto;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.15));
}

.nav-logo-img {
    height: 56px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.15));
}

.logo-rest {
    color: var(--text-primary);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.8125rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.auth-note {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

/* ---- Forms ---- */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    transition: all var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(17, 19, 32, 0.8);
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* ---- Auth Footer ---- */

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ---- Dashboard ---- */

.dashboard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(80px + 3rem) 2rem 3rem;
}

.dashboard-header {
    margin-bottom: 2.5rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dashboard-subtitle {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ---- Report Grid ---- */

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: all 300ms ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 300ms ease;
}

.report-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(99, 102, 241, 0.06);
    transform: translateY(-2px);
}

.report-card:hover::before {
    opacity: 1;
}

.report-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    margin-bottom: 1.25rem;
}

.report-title {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: 0.625rem;
}

.report-desc {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.report-link {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: color var(--transition);
}

.report-card:hover .report-link {
    color: var(--accent-light);
}

.report-link::after {
    content: ' -->';
    font-family: var(--font-mono);
    transition: transform var(--transition);
}

.report-card:hover .report-link::after {
    transform: translateX(3px);
}

/* ---- Featured Card (Magenta Glow) ---- */

.report-card-featured {
    border-color: rgba(236, 72, 153, 0.35);
    box-shadow:
        0 0 0 1px rgba(236, 72, 153, 0.1),
        0 0 20px rgba(236, 72, 153, 0.08),
        0 0 60px rgba(236, 72, 153, 0.04);
}

.report-card-featured::before {
    background: linear-gradient(90deg, transparent, #ec4899, transparent);
    opacity: 0.6;
}

.report-card-featured:hover {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(236, 72, 153, 0.12),
        0 0 80px rgba(236, 72, 153, 0.06);
}

.report-card-featured .report-icon {
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.report-card-featured .report-link {
    color: #ec4899;
}

.report-card-featured:hover .report-link {
    color: #f472b6;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .dashboard-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }

    .nav-inner {
        padding: 0 1rem;
    }
}
