/* Typography - Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Roboto:wght@400;500&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00BFA5;
    --primary-light: #40E0D0;
    --primary-dark: #009688;
    --secondary-color: #001F3F;
    --secondary-light: #003366;
    --secondary-dark: #001529;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --info-color: #00BFA5;
    --info-light: #e0f7f4;
    --info-dark: #009688;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg-color: #FFFFFF;
    --bg-light: #F0F0F0;
    --bg-lighter: #FAFAFA;
    --bg-dark: #E8E8E8;
    --border-color: #E0E0E0;
    --border-light: #F0F0F0;
    --border-dark: #CCCCCC;
    --link-color: #00796b;
    --link-visited-color: #00695c;
    --link-hover-color: #00BFA5;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Colors */
.dark-mode {
    --primary-color: #00BFA5;
    --primary-light: #40E0D0;
    --primary-dark: #009688;
    --secondary-color: #003366;
    --secondary-light: #004C99;
    --secondary-dark: #001F3F;
    --success-color: #10b981;
    --success-light: #064e3b;
    --success-dark: #34d399;
    --danger-color: #f87171;
    --danger-light: #7f1d1d;
    --danger-dark: #fca5a5;
    --warning-color: #fbbf24;
    --warning-light: #78350f;
    --warning-dark: #fcd34d;
    --info-color: #40E0D0;
    --info-light: #003366;
    --info-dark: #40E0D0;
    --text-color: #FFFFFF;
    --text-light: #E0E0E0;
    --text-muted: #AAAAAA;
    --bg-color: #001F3F;
    --bg-light: #003366;
    --bg-lighter: #004C99;
    --bg-dark: #001529;
    --border-color: #003366;
    --border-light: #002244;
    --border-dark: #004C99;
    --link-color: #5eead4;
    --link-visited-color: #99f6e4;
    --link-hover-color: #ccfbf1;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Roboto', Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

a:link {
    color: var(--link-color);
}

a:visited {
    color: var(--link-visited-color);
}

a:hover {
    color: var(--link-hover-color);
}

/* Headings use Montserrat */
h1, h2, h3, h4, h5, h6,
.brand-text,
.nav-brand,
.welcome-section h1,
.auth-card h1,
.card h2,
.card h3,
.section-card h2,
.stat-info .stat-value {
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
}

h1, .brand-text {
    font-weight: 700; /* Bold */
}

h2, h3 {
    font-weight: 600; /* Semi-Bold */
}

h4, h5, h6 {
    font-weight: 600; /* Semi-Bold */
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Dark Mode Scrollbar */
.dark-mode ::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: var(--border-color);
}

/* Header and Navigation */
header {
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

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

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand .brand-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.nav-brand .brand-logo {
    display: block;
    height: 4rem;
    width: auto;
    object-fit: contain;
}

.nav-brand .brand-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

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

.nav-links a,
.nav-links a:visited {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* Messages/Alerts */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #2563eb;
}

/* Footer */
footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    color: var(--text-light);
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary,
.btn-primary:visited {
    background: linear-gradient(135deg, #3b82f6, #10b981);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary,
.btn-secondary:visited {
    background-color: var(--bg-light);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-lighter);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.15);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Avatar Utilities */
.avatar-sm {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
}

.avatar-md {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

.avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

.avatar-xl {
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

.card {
    background-color: var(--bg-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.card-lg {
    padding: 2rem;
}

.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.card-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    max-height: 200px; /* Adjust as needed */
}

.card-logo img {
    max-height: 200px; /* Adjust as needed */
    width: auto;
    object-fit: contain;
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

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

/* HTMX Loading Indicators */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

.htmx-request.htmx-indicator {
    display: inline-block;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Focus Ring Improvements */
.focus-ring:focus,
input:focus,
textarea:focus,
select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
}

/* Form Input Enhancements */
.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Dashboard Layouts */
.dashboard-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Grid Systems */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    border-radius: 0.75rem;
    padding: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.welcome-section h1 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.welcome-section p {
    font-size: 1.125rem;
    opacity: 0.95;
}

/* Stat Cards */
.stat-card {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.stat-card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.stat-icon.blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.stat-icon.green {
    background-color: #d1fae5;
    color: #059669;
}

.stat-icon.purple {
    background-color: #e9d5ff;
    color: #9333ea;
}

.stat-icon.orange {
    background-color: #fed7aa;
    color: #ea580c;
}

.stat-info h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
}

/* Section Cards */
.section-card {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.section-card h2 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Quick Action Cards */
.action-card {
    padding: 1rem;
    border: 2px dashed var(--border-dark);
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
}

.action-card:hover {
    border-color: var(--primary-color);
    background-color: var(--info-light);
    transform: translateY(-2px);
}

.action-card svg {
    width: 2rem;
    height: 2rem;
    color: var(--text-muted);
    margin: 0 auto 0.5rem;
    display: block;
}

.action-card:hover svg {
    color: var(--primary-color);
}

.action-card p {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.action-card:hover p {
    color: var(--primary-dark);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
}

.empty-state svg {
    width: 3rem;
    height: 3rem;
    color: var(--text-muted);
    margin: 0 auto 1rem;
    display: block;
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.empty-state .empty-state-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* User Profile Dropdown */
.profile-dropdown {
    position: relative;
}

.profile-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-button:hover {
    background-color: var(--bg-light);
}

.profile-avatar {
    object-fit: cover;
}

.profile-initials {
    background: linear-gradient(135deg, var(--primary-color), var(--success-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
}

.profile-button .profile-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: left;
    line-height: 1.2;
    margin: 0;
}

.profile-button .profile-info .profile-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.profile-button .profile-info .profile-email {
    font-size: 0.75rem;
    color: var(--text-light);
}

.profile-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 14rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    z-index: 50;
}

.profile-dropdown-menu.show {
    display: block;
}

.profile-dropdown-menu a,
.profile-dropdown-menu a:visited,
.profile-dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease;
}

.profile-dropdown-menu a:hover,
.profile-dropdown-menu button:hover {
    background-color: var(--bg-light);
}

.profile-dropdown-menu svg {
    width: 1rem;
    height: 1rem;
    color: var(--text-light);
}

.profile-dropdown-menu hr {
    margin: 0.25rem 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* Dark Mode Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-color);
    font-size: 0.875rem;
    min-width: 2.5rem;
    height: 2.5rem;
}

.theme-toggle:hover {
    background-color: var(--bg-lighter);
    border-color: var(--border-dark);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--text-color);
    flex-shrink: 0;
}

/* Dark mode alert adjustments */
.dark-mode .alert-success {
    background-color: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-color);
}

.dark-mode .alert-error {
    background-color: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger-color);
}

.dark-mode .alert-warning {
    background-color: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-color);
}

.dark-mode .alert-info {
    background-color: var(--info-light);
    color: var(--info-dark);
    border: 1px solid var(--info-color);
}

/* Organization Badge */
.org-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--info-light);
    border: 1px solid var(--info-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--info-dark);
    margin-bottom: 1rem;
}

.org-badge svg {
    width: 1rem;
    height: 1rem;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .welcome-section h1 {
        font-size: 1.5rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
    
    .dashboard-container {
        padding: 1rem;
    }
    
    .stat-card-content {
        flex-direction: column;
        text-align: center;
    }
    
    .stat-info .stat-value {
        font-size: 1.75rem;
    }
    
    .profile-info {
        display: none;
    }
}

/* Authentication Pages */
.auth-container {
    max-width: 450px;
    margin: 2rem auto;
}

.auth-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.auth-card p {
    margin-bottom: 1.5rem;
}

.btn-google,
.btn-google:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-google:hover {
    background: var(--bg-light);
    box-shadow: var(--shadow);
}

.btn-google svg {
    flex-shrink: 0;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-light);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.text-center {
    text-align: center;
}

.auth-form .form-group,
.org-form .form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions .btn {
    flex: 1;
}

.organization-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .organization-options {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

.option-card {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
}

.option-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-color);
}

.option-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.option-card .form-group {
    margin-bottom: 1rem;
}

.option-card .btn-block {
    width: 100%;
}

.icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.notice-box {
    background-color: var(--warning-bg, #fef3c7);
    border: 1px solid var(--warning-border, #f59e0b);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

.notice-box p {
    margin: 0;
    color: var(--warning-text, #92400e);
}

/* Form Pages */
.form-container {
    max-width: 500px;
    margin: 2rem auto;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.info-box {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--info-light);
    border: 1px solid var(--info-color);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.info-box i {
    color: var(--info-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-box strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--info-dark);
}

.info-box p {
    margin: 0;
    color: var(--info-dark);
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    background-color: var(--bg-color);
    color: var(--text-color);
}

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

/* Form Helper Text */
.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Form Error Messages */
.error-message {
    display: block;
    margin-top: 0.5rem;
    color: var(--danger-color);
    font-size: 0.875rem;
}

.error-message p {
    margin: 0.25rem 0;
}

.form-group.has-error label,
label.label-error {
    color: var(--danger-color);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea,
input.input-error,
select.input-error,
textarea.input-error,
input.border-danger,
select.border-danger,
textarea.border-danger {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus,
input.input-error:focus,
select.input-error:focus,
textarea.input-error:focus {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.text-danger,
.field-error {
    color: var(--danger-color);
    font-size: 0.875rem;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.form-errors-summary {
    margin-bottom: 1rem;
}

.form-errors-summary p {
    margin: 0.25rem 0;
}

.form-errors-summary p:first-child {
    margin-top: 0;
}

.form-errors-summary p:last-child {
    margin-bottom: 0;
}

/* Form Section Headers */
.form-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.password-requirements {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.password-requirements h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
}

.password-requirements ul {
    margin: 0;
    padding-left: 1.5rem;
}

.password-requirements li {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0.25rem 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.btn-back,
.btn-back:visited {
    color: var(--text-light);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--text-color);
}

.personal-info-form {
    padding: 1.5rem;
}

.form-group-section {
    margin-bottom: 2rem;
}

.form-group-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Accessible visually hidden labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Compact job seeker skills editor (professional background) */
.seeker-skills-editor {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem 0.55rem;
    background-color: var(--bg-light);
}

.seeker-skills-column-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.75rem 4.5rem 2.5rem;
    gap: 0.5rem 0.65rem;
    align-items: center;
    padding: 0.15rem 0 0.4rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.seeker-skills-column-head .seeker-skills-col-rate {
    text-align: center;
}

.seeker-skills-column-head .seeker-skills-col-months {
    text-align: center;
}

.seeker-skills-editor > .seeker-skill-form-row {
    padding: 0.35rem 0;
}

.seeker-skills-editor > .seeker-skill-form-row + .seeker-skill-form-row {
    border-top: 1px solid var(--border-color);
}

.seeker-skill-row-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3.75rem 4.5rem 2.5rem;
    gap: 0.5rem 0.65rem;
    align-items: center;
}

.seeker-skill-row-grid .form-group {
    margin-bottom: 0;
}

.seeker-skill-row-grid .seeker-skill-name-cell input.form-control,
.seeker-skill-row-grid .seeker-skill-rate-cell input.form-control {
    padding: 0.45rem 0.55rem;
    font-size: 0.9375rem;
}

.seeker-skill-rating-input {
    width: 100%;
    min-width: 0;
    text-align: center;
}

.seeker-skill-months-input {
    width: 100%;
    min-width: 0;
    text-align: center;
    padding: 0.45rem 0.35rem !important;
    font-size: 0.875rem !important;
}

.seeker-skill-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.seeker-skill-remove {
    padding: 0.35rem 0.45rem !important;
    min-height: 2.25rem;
    min-width: 2.25rem;
    color: var(--text-color);
}

.seeker-skill-remove svg {
    display: block;
}

.seeker-skill-remove:hover:not(:disabled) {
    color: var(--danger-color);
}

.seeker-skill-row-foot {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.2rem;
    padding-left: 0.05rem;
}

.seeker-skill-row-foot .error-message {
    font-size: 0.8125rem;
}

.seeker-skills-add-btn {
    margin-top: 0.65rem;
}

@media (max-width: 520px) {
    .seeker-skills-column-head,
    .seeker-skill-row-grid {
        grid-template-columns: minmax(0, 1fr) 3.25rem 3.75rem 2.35rem;
        gap: 0.4rem 0.45rem;
    }
}

/* Job seeker matched jobs list */
.matched-jobs-header {
    margin-bottom: 2rem;
}

.matched-jobs-header h1 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.matched-jobs-intro {
    max-width: 42rem;
    line-height: 1.5;
}

.matched-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.matched-job-card-head {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.35rem;
}

.matched-job-title {
    margin: 0;
    font-size: 1.125rem;
}

.matched-job-meta {
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
}

.matched-job-salary {
    margin: 0.5rem 0 0;
}

.empty-state-card {
    padding: 1.5rem;
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background-color: var(--bg-color);
    color: var(--text-color);
}

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

.validation-success {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.validation-success.show {
    display: block;
}

.validation-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.validation-error.show {
    display: block;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.upload-form {
    padding: 1.5rem;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.current-picture {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-preview {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.no-picture {
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-light);
}

.no-picture i {
    font-size: 4rem;
}

.image-label {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
}

.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group input[type="file"] {
    display: none;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.file-label:hover {
    background-color: var(--primary-dark);
}

.file-name {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.requirements {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
}

.requirements h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirements li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.requirements li i {
    color: var(--success-color);
    font-size: 0.75rem;
}

.preview-container {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
}

.preview-container h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.image-preview {
    max-width: 100%;
    max-height: 300px;
    border-radius: 0.5rem;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary:disabled,
#add-skill-btn:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    filter: grayscale(0.25);
}

.upload-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: var(--bg-light);
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 1rem;
}

.upload-drop-zone:hover {
    border-color: var(--primary-color);
    background-color: var(--info-light);
}

.upload-drop-zone.drag-over {
    border-color: var(--primary-color);
    background-color: var(--info-light);
}

.upload-drop-zone i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.upload-drop-zone p {
    margin: 0.5rem 0;
    color: var(--text-light);
}

.upload-drop-zone .highlight {
    color: var(--primary-color);
    font-weight: 500;
}

.validation-message {
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    display: none;
}

.validation-message.show {
    display: block;
}

.validation-message.error {
    background-color: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger-color);
}

.validation-message.warning {
    background-color: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-color);
}

.validation-message.success {
    background-color: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-color);
}

@media (max-width: 768px) {
    .upload-section {
        grid-template-columns: 1fr;
    }
}

/* Profile Pages */
.oauth-header {
    margin-bottom: 2rem;
}

.oauth-header h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.email-preferences-form .email-preference-option {
    margin-bottom: 1.25rem;
}

.email-preferences-form .email-preference-option label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0;
    cursor: pointer;
}

.email-preferences-form input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.email-preferences-form .email-preference-copy {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-preferences-form .email-preference-help {
    font-size: 0.9rem;
    font-weight: 400;
}

.oauth-providers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.provider-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    transition: all 0.2s;
    background: var(--bg-color);
}

.provider-card.connected {
    border-color: var(--success-color);
    background-color: var(--success-light);
}

.provider-card:hover {
    box-shadow: var(--shadow-md);
}

.provider-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.provider-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.provider-icon.danger {
    background-color: var(--danger-color);
}

.provider-icon.info {
    background-color: var(--info-color);
}

.provider-icon.primary {
    background-color: #0077b5;
}

.provider-details h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: var(--bg-light);
    color: var(--text-light);
}

.status-badge.connected {
    background-color: var(--success-light);
    color: var(--success-dark);
}

.provider-actions form {
    margin: 0;
}

.btn-outline-danger {
    background-color: transparent;
    color: var(--danger-color);
    border: 2px solid var(--danger-color);
}

.btn-outline-danger:hover:not(:disabled) {
    background-color: var(--danger-color);
    color: white;
}

.back-link {
    text-align: center;
}

@media (max-width: 640px) {
    .provider-card {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .provider-info {
        flex-direction: column;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.btn-edit {
    color: var(--link-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.btn-edit:visited {
    color: var(--link-color);
}

.btn-edit:hover {
    color: var(--link-hover-color);
    background-color: var(--bg-light);
}

.profile-info {
    margin-top: 1rem;
}

/* Job seeker professional summary on profile */
.job-seeker-professional-card .profile-pro-subsection {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.job-seeker-professional-card .profile-pro-subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.profile-pro-subsection-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.profile-pro-subsection-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
}

.profile-pro-edit-link {
    flex-shrink: 0;
    font-size: 0.8125rem;
    padding: 0.35rem 0.65rem;
}

.profile-about-body {
    white-space: pre-wrap;
    line-height: 1.55;
    margin: 0;
    color: var(--text-color);
}

.profile-pro-value {
    margin: 0;
}

.profile-pro-empty {
    margin: 0;
}

.profile-pro-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-pro-list li {
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border-color);
}

.profile-pro-list li:last-child {
    border-bottom: none;
}

.profile-pro-list .muted {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 0.2rem;
}

.info-row {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 600;
    width: 150px;
    flex-shrink: 0;
    color: var(--text-color);
}

.info-row .value {
    flex-grow: 1;
    color: var(--text-color);
}

.text-muted {
    color: var(--text-light);
}

.profile-picture-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.no-profile-pic {
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.no-profile-pic i {
    font-size: 2.5rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-link {
    background: none;
    color: var(--link-color);
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-left: 0.5rem;
}

.btn-link:visited {
    color: var(--link-color);
}

.btn-link:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

.profile-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Messaging notifications */
.message-dropdown-content {
    padding: 0.5rem;
}

.message-item {
    margin-bottom: 0.5rem;
    padding: 1rem;
}

.message-item.unread,
.thread-summary-card.unread {
    border-left: 3px solid var(--primary-color);
    background-color: var(--info-light);
}

.thread-summary-card.active {
    border-color: var(--primary-color);
}

.message-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 700;
    color: var(--text-color);
}

.message-subject {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.message-body {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.message-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.message-view-btn,
.message-view-btn:visited {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.message-view-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-color);
}

.message-mark-read-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.message-dropdown-footer {
    text-align: center;
    margin-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.message-unread-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--primary-color);
}

.message-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--primary-color);
    flex-shrink: 0;
}


/* Searchable Select */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-dropdown {
    list-style: none;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
}

.searchable-select-dropdown li {
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-color, #333);
}

.searchable-select-dropdown li:hover {
    background-color: var(--bg-light);
}

.searchable-select-dropdown li.selected {
    background-color: var(--primary-color);
    color: var(--text-color);
}
