/* X Business Club — страница входа и хедер */

html {
    color-scheme: light;
}

html[data-theme="dark"],
html[data-theme="auto"] {
    color-scheme: light;
}

.theme-toggle,
#admin-theme-toggle-wrapper {
    display: none !important;
}

/* Django dark_mode.css пишет тёмные токены в :root при системной dark scheme.
   Держим светлую палитру независимо от OS и data-theme. */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #79aec8;
        --secondary: #417690;
        --accent: #f5dd5d;
        --primary-fg: #fff;
        --body-fg: #333;
        --body-bg: #fff;
        --body-quiet-color: #666;
        --body-medium-color: #444;
        --body-loud-color: #000;
        --header-color: #ffc;
        --header-branding-color: var(--accent);
        --header-bg: var(--secondary);
        --header-link-color: var(--primary-fg);
        --breadcrumbs-fg: #c4dce8;
        --breadcrumbs-link-fg: var(--body-bg);
        --breadcrumbs-bg: #264b5d;
        --link-fg: #417893;
        --link-hover-color: #036;
        --link-selected-fg: var(--secondary);
        --hairline-color: #e8e8e8;
        --border-color: #ccc;
        --error-fg: #ba2121;
        --message-success-bg: #dfd;
        --message-warning-bg: #ffc;
        --message-error-bg: #ffefef;
        --darkened-bg: #f8f8f8;
        --selected-bg: #e4e4e4;
        --selected-row: #ffc;
        --button-fg: #fff;
        --button-bg: var(--secondary);
        --button-hover-bg: #205067;
        --default-button-bg: #205067;
        --default-button-hover-bg: var(--secondary);
        --close-button-bg: #747474;
        --close-button-hover-bg: #333;
        --delete-button-bg: #ba2121;
        --delete-button-hover-bg: #a41515;
        --object-tools-fg: var(--button-fg);
        --object-tools-bg: var(--close-button-bg);
        --object-tools-hover-bg: var(--close-button-hover-bg);
        color-scheme: light;
    }
}

html[data-theme="dark"] {
    --primary: #79aec8;
    --secondary: #417690;
    --accent: #f5dd5d;
    --primary-fg: #fff;
    --body-fg: #333;
    --body-bg: #fff;
    --body-quiet-color: #666;
    --body-medium-color: #444;
    --body-loud-color: #000;
    --header-color: #ffc;
    --header-branding-color: var(--accent);
    --header-bg: var(--secondary);
    --header-link-color: var(--primary-fg);
    --breadcrumbs-fg: #c4dce8;
    --breadcrumbs-link-fg: var(--body-bg);
    --breadcrumbs-bg: #264b5d;
    --link-fg: #417893;
    --link-hover-color: #036;
    --link-selected-fg: var(--secondary);
    --hairline-color: #e8e8e8;
    --border-color: #ccc;
    --error-fg: #ba2121;
    --message-success-bg: #dfd;
    --message-warning-bg: #ffc;
    --message-error-bg: #ffefef;
    --darkened-bg: #f8f8f8;
    --selected-bg: #e4e4e4;
    --selected-row: #ffc;
    --button-fg: #fff;
    --button-bg: var(--secondary);
    --button-hover-bg: #205067;
    --default-button-bg: #205067;
    --default-button-hover-bg: var(--secondary);
    --close-button-bg: #747474;
    --close-button-hover-bg: #333;
    --delete-button-bg: #ba2121;
    --delete-button-hover-bg: #a41515;
    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);
    color-scheme: light;
}

:root {
    --xbc-primary: #6F2DBD;
    --xbc-primary-accent: #B575FF;
    --xbc-bg: #F6F4F1;
    --xbc-surface: #FFFFFF;
    --xbc-text: #17131D;
    --xbc-text-muted: #6B6475;
    --xbc-border: rgba(111, 45, 189, 0.18);
    --xbc-cta-gradient: linear-gradient(180deg, var(--xbc-primary-accent), var(--xbc-primary));
}

/* ========== Страница входа ========== */
body.login {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif !important;
    background: var(--xbc-bg) !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
}

body.login #header {
    display: none !important;
}

body.login #container {
    background: var(--xbc-surface) !important;
    border: 1px solid var(--xbc-border) !important;
    border-radius: 20px !important;
    box-shadow: none !important;
    padding: 40px 36px 36px !important;
    max-width: 420px !important;
    width: 100% !important;
    margin: 0 !important;
}

body.login #content {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

body.login #branding {
    margin: 0 0 28px !important;
    padding: 0 !important;
}

body.login .admin-brand--login {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

body.login .admin-login-logo img {
    display: block;
    width: 56px;
    height: 56px;
}

body.login .admin-login-wordmark-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 14px;
    background: var(--xbc-cta-gradient);
}

body.login .admin-login-wordmark {
    display: block;
    width: min(200px, 100%);
    height: auto;
    filter: none;
}

body.login .admin-login-subtitle {
    margin: 0;
    color: var(--xbc-text-muted);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

body.login h1 {
    display: none !important;
}

body.login .form-row {
    margin-bottom: 18px !important;
}

body.login label {
    color: var(--xbc-text) !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    margin-bottom: 8px !important;
    display: block !important;
}

body.login input[type="text"],
body.login input[type="password"] {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 1px solid var(--xbc-border) !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    background: var(--xbc-surface) !important;
    color: var(--xbc-text) !important;
    box-sizing: border-box !important;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus {
    border-color: var(--xbc-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(111, 45, 189, 0.12) !important;
}

body.login .submit-row {
    margin-top: 24px !important;
    text-align: center !important;
}

body.login input[type="submit"] {
    width: 100% !important;
    padding: 15px 16px !important;
    background: var(--xbc-cta-gradient) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;
    box-shadow: none !important;
}

body.login input[type="submit"]:hover {
    opacity: 0.92 !important;
    transform: none !important;
    box-shadow: none !important;
}

body.login .errornote {
    background: #fdecec !important;
    border-left: 4px solid #dc3545 !important;
    color: #721c24 !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
}

body.login .password-reset-link {
    margin-top: 4px;
}

body.login .password-reset-link a {
    color: var(--xbc-primary) !important;
    font-weight: 600;
    text-decoration: none;
}

body.login .password-reset-link a:hover {
    text-decoration: underline;
}

body.login .form-row .help {
    color: var(--xbc-text-muted) !important;
    font-size: 12px !important;
    margin-top: 5px !important;
}

/* ========== Хедер (все страницы кроме логина) ========== */
#header,
body.admin #header {
    position: relative !important;
    background: var(--xbc-primary) !important;
    color: #fff !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

#header a,
#header #branding,
#header #branding h1,
#header #branding h1 a,
#header #user-tools,
#header #user-tools a,
body.admin #header a,
body.admin #header #branding,
body.admin #header #branding h1,
body.admin #header #branding h1 a,
body.admin #header #user-tools,
body.admin #header #user-tools a {
    color: #fff !important;
}

#branding,
body.admin #branding {
    background: transparent !important;
}

#branding h1,
#branding h1 a,
body.admin #branding h1,
body.admin #branding h1 a {
    color: #fff !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

#branding .admin-brand,
body.admin #branding .admin-brand {
    margin: 0;
    padding: 0;
}

#branding .admin-brand-link,
body.admin #branding .admin-brand-link {
    display: inline-flex !important;
    align-items: center;
    color: #fff !important;
    text-decoration: none !important;
    line-height: 1.2;
}

#branding .admin-brand-wordmark,
body.admin #branding .admin-brand-wordmark {
    display: block;
    width: auto;
    height: 36px;
    max-width: min(168px, 42vw);
    flex-shrink: 0;
}

#branding .admin-brand-test,
body.admin #branding .admin-brand-test {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    color: #fff !important;
}

body.login .admin-login-wordmark-wrap .admin-brand-test {
    margin-left: 10px;
    font-size: 26px;
    color: #fff !important;
}

#header a:link,
#header a:visited,
body.admin #header a:link,
body.admin #header a:visited {
    color: #fff !important;
}

#header a:hover,
body.admin #header a:hover {
    color: var(--xbc-primary-accent) !important;
}

.admin-header-docs,
#header .admin-header-docs,
body.admin #header .admin-header-docs {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 7px 18px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: #fff !important;
    text-decoration: none !important;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.08);
}

#header .admin-header-docs:hover,
body.admin #header .admin-header-docs:hover,
#header .admin-header-docs:focus,
body.admin #header .admin-header-docs:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 860px) {
    .admin-header-docs,
    #header .admin-header-docs,
    body.admin #header .admin-header-docs {
        font-size: 12px;
        padding: 5px 10px;
    }
}

#user-tools,
body.admin #user-tools {
    color: #fff !important;
}

#user-tools a:link,
#user-tools a:visited,
body.admin #user-tools a:link,
body.admin #user-tools a:visited {
    color: #fff !important;
}

#user-tools a:hover,
body.admin #user-tools a:hover {
    color: var(--xbc-primary-accent) !important;
}

.group-landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.group-landing-card {
    display: block;
    border: 1px solid var(--xbc-border);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
    text-decoration: none;
    transition: border-color 0.2s ease;
    min-height: 140px;
}

.group-landing-card:hover,
.group-landing-card:focus {
    border-color: var(--xbc-primary);
    box-shadow: none;
    text-decoration: none;
}

.group-landing-card h2 {
    margin: 0 0 8px;
    color: var(--xbc-text);
    font-size: 18px;
    font-weight: 700;
}

.group-landing-card p {
    margin: 0 0 12px;
    color: #4a4a4a;
}

.group-landing-card__button {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--xbc-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* Кнопки «Связаться» в object-tools карточки пользователя и стартапа */
body.change-form.model-user .object-tools li,
body.change-form.model-startup .object-tools li {
    height: auto;
}

body.change-form.model-user .object-tools a.contactlink--primary:link,
body.change-form.model-user .object-tools a.contactlink--primary:visited,
body.change-form.model-startup .object-tools a.contactlink--primary:link,
body.change-form.model-startup .object-tools a.contactlink--primary:visited {
    background: var(--xbc-primary);
    color: #fff;
}

body.change-form.model-user .object-tools a.contactlink--primary:hover,
body.change-form.model-user .object-tools a.contactlink--primary:focus,
body.change-form.model-startup .object-tools a.contactlink--primary:hover,
body.change-form.model-startup .object-tools a.contactlink--primary:focus {
    background: #5a24a0;
    color: #fff;
}

body.change-form.model-user #content > h1:nth-of-type(n + 2) {
    display: none;
}
