/* Members Portal CSS - Inherits main site design system */

/* Imports main site tokens */
:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f7fafc;
    --color-text: #4a5568;
    --color-text-dark: #2d3748;
    --color-accent: #2b7ac4;
    --color-accent-dark: #1e5a94;
    --color-border: #cbd5e0;
    --color-success: #48bb78;
    --color-error: #f56565;
    --color-warning: #ed8936;

    --radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg-alt);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Typography */
h1, h2, h3 {
    font-family: Georgia, serif;
    color: var(--color-text-dark);
    line-height: 1.2;
    font-weight: 600;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

/* Navigation */
.nav {
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 0;
    margin-bottom: 2rem;
}

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

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: Georgia, serif;
    color: var(--color-text-dark);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

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

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

/* Cards */
.card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

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

label {
    display: block;
    font-weight: 600;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--color-accent-dark);
}

.btn-secondary {
    background-color: var(--color-text);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: var(--color-text-dark);
}

.btn-danger {
    background-color: var(--color-error);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #e53e3e;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Flash messages */
.flash {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.flash-success {
    background-color: #c6f6d5;
    color: #22543d;
    border-left: 4px solid var(--color-success);
}

.flash-error {
    background-color: #fed7d7;
    color: #742a2a;
    border-left: 4px solid var(--color-error);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

th {
    background-color: var(--color-bg-alt);
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    color: var(--color-text-dark);
}

td {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
}

tr:hover {
    background-color: var(--color-bg-alt);
}

/* Sidebar layout */
.layout-sidebar {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sidebar {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--color-bg-alt);
    color: var(--color-accent);
}

.main-content {
    min-height: calc(100vh - 200px);
}

/* Login page specific */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-text-dark) 100%);
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(30, 90, 148, 0.25);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
}

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

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

.login-header p {
    color: var(--color-text);
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--color-text); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
    .layout-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .nav-links {
        display: none;
    }
}
