/* ContSoft Landing Page Design System
   Based on PythonC/c.css - Corporate styling with brand colors */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: light dark;

    /* Corporate Brand Colors */
    --brand-red: #e00102;
    --brand-red-hover: #c40102;
    --brand-red-light: #fef2f2;
    --brand-dark: #1c1c1c;

    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f7f7;
    --bg-tertiary: #f2f2f2;
    --bg-elevated: #ffffff;
    --text-primary: #1c1c1c;
    --text-secondary: #505050;
    --text-tertiary: #7a7a7a;
    --border-color: #e5e5e5;
    --border-hover: #c2c2c2;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.12);
    --accent-primary: var(--brand-red);
    --accent-primary-hover: var(--brand-red-hover);
    --accent-primary-light: var(--brand-red-light);
    --accent-green: #35c14e;
    --accent-green-light: #ecfdf5;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --input-bg: #ffffff;
    --input-border: #d4d4d4;
    --input-focus-border: var(--brand-red);
    --input-focus-ring: rgba(224, 1, 2, 0.12);
    --header-accent: var(--brand-red);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #0f0f0f;
        --bg-tertiary: #262626;
        --bg-elevated: #262626;
        --text-primary: #f5f5f5;
        --text-secondary: #a3a3a3;
        --text-tertiary: #737373;
        --border-color: #363636;
        --border-hover: #525252;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
        --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
        --accent-primary-light: rgba(224, 1, 2, 0.15);
        --accent-green: #4ade80;
        --accent-green-light: rgba(34, 197, 94, 0.15);
        --accent-blue: #3b82f6;
        --accent-blue-hover: #2563eb;
        --input-bg: #262626;
        --input-border: #404040;
        --input-focus-ring: rgba(224, 1, 2, 0.2);
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-secondary);
    height: 100%;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.011em;
    overflow: hidden;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-height: 900px) {
    .container {
        padding: 20px 24px;
        justify-content: flex-start;
    }

    .container--login {
        justify-content: center;
    }

    .card {
        padding: 24px 32px;
    }

    .hub-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .header-logo {
        margin-bottom: 12px;
    }

    .welcome-section {
        margin-bottom: 16px;
    }

    .module-grid {
        gap: 10px;
    }

    .module-card {
        padding: 14px 20px;
        min-height: auto;
    }

    .section-divider {
        margin: 14px 0 12px;
    }

    .footer {
        padding: 12px 0 4px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 32px 16px;
    }
}

.card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 40px 44px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* Corporate header accent - solid brand color */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-red);
    border-radius: 16px 16px 0 0;
}

@media (max-width: 480px) {
    .card {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .card::before {
        border-radius: 12px 12px 0 0;
    }
}

h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
    color: var(--text-primary);
}

h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--text-primary);
}

p {
    margin: 8px 0;
    line-height: 1.6;
    color: var(--text-secondary);
}

label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    min-width: 180px;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.15s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--border-hover);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* Primary Button - Blue */
button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 8px;
    border: none;
    background: var(--brand-red);
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    letter-spacing: 0.01em;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background: var(--brand-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 1, 2, 0.35);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button:focus,
button:focus-visible {
    outline: none;
    box-shadow: none;
}

.small {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Links - no blue/purple hyperlink styling */
a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--brand-red);
}

a:visited {
    color: var(--text-secondary);
}

.error {
    color: var(--brand-red);
    font-weight: 500;
    padding: 12px 16px;
    background: var(--accent-primary-light);
    border-radius: 8px;
    margin: 16px 0;
    border-left: 3px solid var(--brand-red);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.error::before {
    content: '!';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--brand-red);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 8px;
    font-size: 12px;
    color: var(--text-tertiary);
    letter-spacing: 0.02em;
}

/* Header Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.logo-full {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Subtle animation on page load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .card {
        animation: none;
    }
}


/* ===========================================
   Module Hub Styles
   =========================================== */

.hub-card {
    max-width: 1200px;
    margin: 0 auto;
}

.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.hub-me {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.hub-me .me-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 0;
}

.hub-me .me-chip .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.hub-me .me-chip .meta {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.logout-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.logout-link:hover {
    color: var(--brand-red);
    background: var(--accent-primary-light);
}

.welcome-section {
    margin-bottom: 32px;
}

.welcome-section h2 {
    margin-bottom: 4px;
}

/* Module Grid - 4 cards */
.module-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .module-grid {
        grid-template-columns: 1fr;
    }
}

/* Module Card Base */
.module-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    position: relative;
    min-height: 116px;
}

/* Active Module Card */
.module-active {
    cursor: pointer;
}

.module-active:hover {
    border-color: var(--brand-red);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.module-active:hover .module-icon {
    color: var(--brand-red);
    background: var(--accent-primary-light);
}

.module-active:hover .module-arrow {
    color: var(--brand-red);
    transform: translateX(4px);
}

/* Disabled Module Card */
.module-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: var(--bg-tertiary);
}

.module-disabled .module-icon {
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

.module-disabled .module-title,
.module-disabled .module-desc {
    color: var(--text-tertiary);
}

/* Module Icon */
.module-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.module-icon svg {
    width: 24px;
    height: 24px;
}

/* Module Content */
.module-content {
    flex: 1;
    min-width: 0;
}

.module-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.module-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* Module Arrow (for active cards) */
.module-arrow {
    color: var(--text-tertiary);
    transition: all 0.2s ease;
}

.module-arrow svg {
    width: 20px;
    height: 20px;
}

/* Module Badge (for disabled cards) */
.module-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--text-tertiary);
    color: white;
}

/* Section Divider */
.section-divider {
    display: flex;
    align-items: center;
    margin: 32px 0 24px;
    gap: 16px;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
}

.section-divider::before {
    background: linear-gradient(to right, transparent, var(--border-color));
}

.section-divider::after {
    background: linear-gradient(to left, transparent, var(--border-color));
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* Admin Section - single column for smaller sections */
.module-grid--admin {
    grid-template-columns: repeat(2, 1fr);
    max-width: 960px;
}


/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
    margin-bottom: 0;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    color: var(--text-tertiary);
    margin-bottom: 16px;
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 400px;
    margin: 0;
}

@media (max-height: 900px) {
    .empty-state {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .empty-state {
        padding: 28px 16px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}