/*
 * Afflines public UI unification layer.
 * Loaded after page-specific styles so current public views share one
 * restrained visual system without changing their business interactions.
 */

:root {
    --aff-primary: #0969da;
    --aff-primary-hover: #0757b7;
    --aff-primary-dark: #064b9a;
    --aff-primary-soft: #eaf3ff;
    --aff-primary-soft-2: #f4f8fc;
    --aff-text: #20252b;
    --aff-text-secondary: #46505a;
    --aff-muted: #66717d;
    --aff-soft-text: #87919c;
    --aff-border: #dfe3e8;
    --aff-border-dark: #c8ced6;
    --aff-border-soft: #edf0f3;
    --aff-background: #f6f7f9;
    --aff-surface: #ffffff;
    --aff-success: #18753c;
    --aff-success-soft: #e9f7ee;
    --aff-warning: #8a5b00;
    --aff-warning-soft: #fff7df;
    --aff-danger: #c52a35;
    --aff-danger-soft: #fff0f1;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 10px;
    --control-height: 40px;
    --control-radius: 6px;
    --control-horizontal-padding: 12px;
    --shadow-card: none;
    --shadow-card-hover: none;
}

html,
body {
    background: var(--aff-background);
    color: var(--aff-text);
}

body {
    font-size: 14px;
    line-height: 1.6;
}

main {
    min-height: calc(100vh - 68px);
}

h1,
h2,
h3,
h4 {
    color: var(--aff-text);
    font-weight: 650;
}

p,
li {
    color: var(--aff-text-secondary);
}

.site-header {
    border-bottom: 1px solid var(--aff-border-soft);
    background: rgba(255, 255, 255, .98);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-wrap {
    min-height: 64px;
}

.nav-link {
    padding-top: 23px;
    padding-bottom: 21px;
    color: var(--aff-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--aff-primary);
}

.account-menu-trigger,
.account-menu-dropdown,
.mobile-menu,
.site-footer {
    box-shadow: none;
}

.account-menu-trigger,
.account-menu-dropdown {
    border-color: var(--aff-border-soft);
}

.account-menu-item:hover,
.account-menu-item.active {
    background: var(--aff-primary-soft-2);
    color: var(--aff-primary);
}

.btn,
.profile-action,
.profile-action-button,
.profile-save-button,
.auth-submit,
.my-offers-add-button,
.my-offer-edit-button,
.my-offers-secondary-button,
.offer-action,
.settings-card button {
    min-height: 40px;
    border-radius: var(--radius-sm);
    box-shadow: none;
    font-weight: 600;
    transform: none;
}

/* One compact control system across all current public pages. */
.btn,
.profile-action,
.profile-action-button,
.profile-save-button,
.auth-submit,
.my-offers-add-button,
.my-offer-edit-button,
.my-offers-secondary-button,
.my-offers-back-button,
.my-offers-delete-button,
.offer-action,
.settings-card button,
.aff-chat-btn,
.filter-popover-trigger,
.profile-single-trigger,
.profile-multi-trigger,
.account-menu-trigger,
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.settings-input,
.search-box input {
    min-height: var(--control-height);
    box-sizing: border-box;
    border-radius: var(--control-radius);
    font-size: 13px;
}

.btn,
.profile-action,
.profile-action-button,
.profile-save-button,
.auth-submit,
.my-offers-add-button,
.my-offer-edit-button,
.my-offers-secondary-button,
.my-offers-back-button,
.my-offers-delete-button,
.offer-action,
.settings-card button,
.aff-chat-btn {
    height: var(--control-height);
    padding: 0 var(--control-horizontal-padding);
    line-height: 1;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
.form-control,
.settings-input,
.search-box input {
    height: var(--control-height);
    padding: 0 var(--control-horizontal-padding);
}

textarea {
    min-height: 96px;
    height: auto;
    padding: 10px var(--control-horizontal-padding);
    line-height: 1.5;
}

.filter-popover-trigger,
.profile-single-trigger,
.profile-multi-trigger,
.account-menu-trigger {
    height: var(--control-height);
    padding: 0 var(--control-horizontal-padding);
}

.mobile-menu-button,
.aff-chat-icon-button {
    width: var(--control-height);
    height: var(--control-height);
    min-width: var(--control-height);
    min-height: var(--control-height);
}

.btn:hover,
.profile-action:hover,
.profile-action-button:hover,
.profile-save-button:hover,
.auth-submit:hover,
.my-offers-add-button:hover,
.my-offer-edit-button:hover,
.my-offers-secondary-button:hover,
.offer-action:hover {
    transform: none;
    box-shadow: none;
}

.btn-primary,
.profile-action-primary,
.profile-save-button,
.auth-submit,
.my-offers-add-button,
.offer-action-primary {
    border-color: var(--aff-primary);
    background: var(--aff-primary);
    color: #ffffff;
}

.btn-primary:hover,
.profile-action-primary:hover,
.profile-save-button:hover,
.auth-submit:hover,
.my-offers-add-button:hover,
.offer-action-primary:hover {
    border-color: var(--aff-primary-hover);
    background: var(--aff-primary-hover);
    color: #ffffff;
}

.btn-secondary,
.btn-soft,
.profile-action-secondary,
.my-offer-edit-button,
.my-offers-secondary-button,
.offer-action-secondary {
    border: 1px solid var(--aff-border);
    background: #ffffff;
    color: var(--aff-text-secondary);
}

.btn-secondary:hover,
.btn-soft:hover,
.profile-action-secondary:hover,
.my-offer-edit-button:hover,
.my-offers-secondary-button:hover,
.offer-action-secondary:hover {
    border-color: var(--aff-border-dark);
    background: var(--aff-primary-soft-2);
    color: var(--aff-text);
}

input,
select,
textarea,
.form-control,
.settings-input,
.profile-field input,
.profile-field select,
.profile-field textarea,
.profile-single-trigger,
.profile-multi-trigger,
.filter-popover-trigger,
.search-box input {
    border: 1px solid var(--aff-border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--aff-text);
    box-shadow: none;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.settings-input:focus,
.profile-field input:focus,
.profile-field select:focus,
.profile-field textarea:focus,
.profile-single-trigger:focus,
.profile-multi-trigger:focus,
.filter-popover.open .filter-popover-trigger {
    border-color: var(--aff-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, .10);
}

.filter-chip,
.quick-chip,
.sort-chip,
.profile-chip,
.profile-select-chip,
.tag,
.offer-tag,
.verified,
.featured-label,
.profile-badge,
.offer-badge,
.my-offer-badge,
.partnership-badge,
.profile-status-badge {
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
}

.filter-chip,
.quick-chip,
.sort-chip,
.profile-chip,
.profile-select-chip,
.tag,
.offer-tag {
    background: #eef1f4;
    color: var(--aff-text-secondary);
}

.filter-chip:hover,
.quick-chip:hover,
.sort-chip:hover {
    background: #e4e8ed;
}

.filter-chip.active,
.quick-chip.active,
.sort-chip.active,
.tag-primary,
.verified,
.profile-badge-primary {
    background: var(--aff-primary-soft);
    color: var(--aff-primary);
}

.tag-success,
.profile-badge-success,
.partnership-badge-success {
    background: var(--aff-success-soft);
    color: var(--aff-success);
}

.tag-warning,
.partnership-badge-warning {
    background: var(--aff-warning-soft);
    color: var(--aff-warning);
}

.directory-header,
.offers-hero,
.offer-hero,
.home-hero,
.hero-section,
.static-page,
.auth-page,
.member-page,
.offer-page,
.directory-section,
.home-section,
.offers-page {
    background: var(--aff-background);
}

.directory-header,
.offers-hero,
.offer-hero {
    border-bottom: 0;
    box-shadow: none;
}

.directory-header h1,
.offers-hero h1,
.offer-hero h1,
.static-page-header h1,
.dashboard-heading h1,
.profile-heading h1,
.settings-header h1 {
    letter-spacing: -.03em;
}

.marketplace-listing-card,
.market-card,
.casino-card,
.affiliate-card,
.offer-card,
.offer-type-card,
.verification-card,
.dashboard-card,
.dashboard-stat-card,
.dashboard-quick-action,
.profile-section,
.profile-completion-card,
.settings-card,
.auth-card,
.static-page-content,
.offer-panel,
.partnership-row,
.my-offers-list,
.my-offers-empty,
.filter-card,
.directory-notice,
.directory-alert,
.profile-alert,
.settings-alert {
    border: 0;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: none;
}

a.marketplace-listing-card:hover,
.marketplace-listing-card:hover,
.market-card:hover,
.casino-card:hover,
.affiliate-card:hover,
.offer-card:hover,
.offer-type-card:hover,
.dashboard-stat-card:hover,
.dashboard-quick-action:hover {
    border: 0;
    background: #fbfcfd;
    box-shadow: none;
    transform: none;
}

.filter-card,
.profile-section,
.settings-card,
.auth-card,
.static-page-content,
.offer-panel,
.dashboard-card {
    padding: 24px;
}

.filter-actions,
.settings-card-footer,
.profile-section-head,
.dashboard-card-head,
.offer-section-title,
.my-offers-list-head {
    border-color: var(--aff-border-soft);
}

.filter-popover-menu,
.profile-single-menu,
.profile-multi-menu,
.partnership-modal-card,
.aff-chat-panel {
    border: 1px solid var(--aff-border-soft);
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(31, 35, 40, .12);
}

.filter-popover-option:hover,
.profile-single-option:hover,
.profile-multi-option:hover {
    background: var(--aff-primary-soft-2);
}

.profile-section-head,
.settings-card-header,
.settings-card-footer,
.dashboard-card-head,
.offer-section-title,
.partnership-modal-head,
.aff-chat-header {
    background: transparent;
}

.profile-section-head,
.settings-card-header,
.dashboard-card-head,
.offer-section-title {
    padding-bottom: 14px;
}

.dashboard-stats,
.dashboard-content-grid,
.profile-form-grid,
.settings-form-grid,
.offer-detail-grid,
.contact-grid {
    gap: 16px;
}

.dashboard-stat-card,
.dashboard-quick-action,
.partnership-row,
.contact-item,
.profile-detail-row,
.condition-row,
.terms-row,
.session-main,
.my-offer-row {
    box-shadow: none;
}

.partnership-row,
.my-offer-row,
.profile-detail-row,
.condition-row,
.terms-row,
.session-main {
    border-color: var(--aff-border-soft);
}

.partnership-row:hover,
.my-offer-row:hover {
    background: var(--aff-primary-soft-2);
}

.auth-page {
    min-height: calc(100vh - 64px);
}

.auth-card {
    max-width: 440px;
}

.auth-benefit-icon,
.dashboard-quick-action-icon,
.verification-check,
.directory-notice-icon {
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--aff-primary-soft);
    color: var(--aff-primary);
}

.profile-switch-track {
    border: 0;
    background: #dfe3e8;
}

.profile-switch input:checked + .profile-switch-track {
    background: var(--aff-primary);
}

.offer-note,
.static-page-note,
.profile-field-help,
.settings-help {
    color: var(--aff-muted);
}

.offer-note,
.static-page-note {
    border: 0;
    border-left: 3px solid var(--aff-primary);
    border-radius: 0;
    background: var(--aff-primary-soft-2);
}

.empty-state,
.offer-empty,
.home-empty,
.partnership-empty,
.sessions-empty,
.profile-empty-text,
.my-offers-empty {
    border: 0;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: none;
}

.site-footer {
    border-top: 1px solid var(--aff-border-soft);
    background: #ffffff;
}

.footer-column a {
    color: var(--aff-muted);
}

.footer-column a:hover {
    color: var(--aff-primary);
}

.aff-chat-trigger {
    border: 0;
    background: var(--aff-primary);
    box-shadow: none;
}

.aff-chat-trigger:hover {
    background: var(--aff-primary-hover);
}

.aff-chat-message.is-mine .aff-chat-bubble {
    background: var(--aff-primary);
}

@media (max-width: 900px) {
    .nav-wrap {
        min-height: 62px;
    }

    .mobile-menu {
        border-top: 1px solid var(--aff-border-soft);
        background: #ffffff;
    }
}

@media (max-width: 700px) {
    .filter-card,
    .profile-section,
    .settings-card,
    .auth-card,
    .static-page-content,
    .offer-panel,
    .dashboard-card {
        padding: 18px;
    }

    .marketplace-listing-card,
    .market-card,
    .casino-card,
    .affiliate-card,
    .offer-card,
    .offer-type-card,
    .dashboard-stat-card,
    .dashboard-quick-action,
    .partnership-row,
    .my-offer-row {
        border-radius: var(--radius);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        transition-duration: .01ms;
        animation-duration: .01ms;
        animation-iteration-count: 1;
    }
}
