/* GDfm Accounts v1.1.0 */

/* ================================================================
   Auth Cards (Login / Register)
   ================================================================ */

.gdfm-auth-card {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--gd-surface, #ffffff);
    border: 1px solid var(--gd-border, #e0e0e0);
    border-radius: 8px;
}

.gdfm-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1.5rem 0;
    color: var(--gd-text, #1a1a1a);
}

/* ================================================================
   Form Elements
   ================================================================ */

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

.gdfm-form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.375rem;
    color: var(--gd-text, #1a1a1a);
}

.gdfm-form-group input[type="text"],
.gdfm-form-group input[type="email"],
.gdfm-form-group input[type="password"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.2;
    font-family: inherit;
    color: var(--gd-text, #1a1a1a);
    background: var(--gd-input-bg, #f7f7f7);
    border: 1px solid var(--gd-border, #d0d0d0);
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.gdfm-form-group input:focus {
    outline: none;
    border-color: var(--gd-accent, #4a90d9);
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.15);
}

.gdfm-form-group input.gdfm-input-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--gd-input-bg, #f0f0f0);
}

.gdfm-field-hint {
    display: block;
    font-size: 0.75rem;
    line-height: 1.2;
    color: var(--gd-text-muted, #888);
    margin-top: 0.25rem;
}

.gdfm-form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gdfm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--gd-text, #1a1a1a);
    cursor: pointer;
}

.gdfm-checkbox-label input[type="checkbox"] {
    margin: 0;
}

.gdfm-link-small {
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--gd-accent, #4a90d9);
    text-decoration: none;
}

.gdfm-link-small:hover {
    text-decoration: underline;
}

.gdfm-form-note {
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--gd-text-muted, #666);
    margin: 0 0 1rem 0;
}

/* ================================================================
   Buttons
   ================================================================ */

.gdfm-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    font-family: inherit;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    text-align: center;
}

.gdfm-btn:hover {
    opacity: 0.85;
}

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

.gdfm-btn-primary {
    width: 100%;
    background: var(--gd-btn-primary-bg, #1a1a1a);
    color: var(--gd-btn-primary-text, #ffffff);
}

.gdfm-btn-secondary {
    width: 100%;
    margin-top: 0.5rem;
    background: var(--gd-btn-secondary-bg, #e8e8e8);
    color: var(--gd-btn-secondary-text, #1a1a1a);
}

.gdfm-btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    width: auto;
}

/* ================================================================
   Messages (success / error)
   ================================================================ */

.gdfm-form-message {
    margin-bottom: 1rem;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.2;
    min-height: 0;
    border-radius: 4px;
    transition: all 0.15s;
}

.gdfm-form-message:empty {
    display: none;
}

.gdfm-form-message.error {
    display: block;
    padding: 0.625rem 0.75rem;
    background: #fef2f2;
    color: #b91c1c;
}

.gdfm-form-message.success {
    display: block;
    padding: 0.625rem 0.75rem;
    background: #f0fdf4;
    color: #15803d;
}

/* ================================================================
   Auth Footer (login/register cross-links)
   ================================================================ */

.gdfm-auth-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gd-border, #e0e0e0);
    text-align: center;
}

.gdfm-auth-footer p {
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--gd-text-muted, #666);
    margin: 0;
}

.gdfm-auth-footer a {
    color: var(--gd-accent, #4a90d9);
    text-decoration: none;
    font-weight: 600;
}

.gdfm-auth-footer a:hover {
    text-decoration: underline;
}

/* ================================================================
   Account Page - Header
   ================================================================ */

.gdfm-account-wrap {
    max-width: 700px;
    margin: 2rem auto;
}

.gdfm-account-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.gdfm-account-username {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: var(--gd-text, #1a1a1a);
}

.gdfm-account-meta {
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--gd-text-muted, #888);
}

.gdfm-account-header .gdfm-btn-small {
    margin-left: auto;
}

/* ================================================================
   Account Page - Tabs
   ================================================================ */

.gdfm-account-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gd-border, #e0e0e0);
    margin-bottom: 1.5rem;
}

.gdfm-tab {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    font-family: inherit;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--gd-text-muted, #888);
    transition: color 0.15s, border-color 0.15s;
}

.gdfm-tab:hover {
    color: var(--gd-text, #1a1a1a);
}

.gdfm-tab.active {
    color: var(--gd-text, #1a1a1a);
    border-bottom-color: var(--gd-text, #1a1a1a);
}

.gdfm-tab-panel {
    display: none;
}

.gdfm-tab-panel.active {
    display: block;
}

/* ================================================================
   Account Page - Stats Grid
   ================================================================ */

.gdfm-stats-section {
    margin-bottom: 1.5rem;
}

.gdfm-stats-heading {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gd-text-muted, #888);
    margin: 0 0 0.625rem 0;
}

.gdfm-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.gdfm-stat-card {
    padding: 1rem;
    background: var(--gd-surface, #ffffff);
    border: 1px solid var(--gd-border, #e0e0e0);
    border-radius: 6px;
    text-align: center;
}

.gdfm-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--gd-text, #1a1a1a);
}

.gdfm-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--gd-text-muted, #888);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ================================================================
   Account Page - Sections
   ================================================================ */

.gdfm-account-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem 0;
    color: var(--gd-text, #1a1a1a);
}

.gdfm-placeholder-note {
    font-size: 0.875rem;
    line-height: 1.2;
    color: var(--gd-text-muted, #888);
    font-style: italic;
}

/* ================================================================
   Dark Mode
   ================================================================ */

html[data-theme="dark"] .gdfm-auth-card,
html[data-theme="dark"] .gdfm-stat-card {
    background: var(--gd-surface);
    border-color: var(--gd-border);
}

html[data-theme="dark"] .gdfm-form-group input[type="text"],
html[data-theme="dark"] .gdfm-form-group input[type="email"],
html[data-theme="dark"] .gdfm-form-group input[type="password"] {
    background: var(--gd-input-bg);
    border-color: var(--gd-border);
    color: var(--gd-text);
}

html[data-theme="dark"] .gdfm-form-group input:focus {
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.25);
}

html[data-theme="dark"] .gdfm-btn-primary {
    background: var(--gd-btn-primary-bg, #e8e8e8);
    color: var(--gd-btn-primary-text, #1a1a1a);
}

html[data-theme="dark"] .gdfm-btn-secondary {
    background: var(--gd-btn-secondary-bg, #333);
    color: var(--gd-btn-secondary-text, #e0e0e0);
}

html[data-theme="dark"] .gdfm-form-message.error {
    background: #451a1a;
    color: #fca5a5;
}

html[data-theme="dark"] .gdfm-form-message.success {
    background: #14532d;
    color: #86efac;
}

html[data-theme="dark"] .gdfm-account-tabs {
    border-bottom-color: var(--gd-border);
}

html[data-theme="dark"] .gdfm-auth-footer {
    border-top-color: var(--gd-border);
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 600px) {
    .gdfm-auth-card {
        margin: 1rem;
        padding: 1.25rem;
    }

    .gdfm-account-wrap {
        margin: 1rem;
    }

    .gdfm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gdfm-account-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gdfm-account-header .gdfm-btn-small {
        margin-left: 0;
    }

    .gdfm-account-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .gdfm-tab {
        white-space: nowrap;
    }
}
