/* Circles — by Meleven Consultancy */
/* Brand colors: Navy #0A2144, Blue #104480, Gold #C69D7A */

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

@font-face {
    font-family: 'system';
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background: #F4F1EC;
    color: #1A2332;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---- Layout shells ---- */

.page-dark {
    background: #0A2144;
    min-height: 100vh;
    color: #EDE3D6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Login ---- */

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0A2144;
    padding: 20px;
}

.login-card {
    background: #0F2C56;
    border: 1px solid #1B3D6B;
    border-radius: 8px;
    padding: 48px 40px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    position: relative;
}

.lang-switch {
    position: absolute;
    top: 16px;
    left: 16px;
    right: 16px;
    text-align: left;
}

html[dir="rtl"] .lang-switch {
    text-align: left;
}

html[dir="ltr"] .lang-switch {
    text-align: right;
}

.lang-switch a {
    font-size: 12px;
    color: #C69D7A;
    border: 1px solid #C69D7A;
    border-radius: 20px;
    padding: 4px 12px;
    display: inline-block;
}

.lang-switch-dark {
    position: absolute;
    top: 24px;
    left: 24px;
}

html[dir="ltr"] .lang-switch-dark {
    left: auto;
    right: 24px;
}

.lang-switch-pill {
    font-size: 12px;
    color: #C69D7A;
    border: 1px solid #C69D7A;
    border-radius: 20px;
    padding: 6px 14px;
}

.brand-icon {
    width: 56px;
    height: auto;
    margin-bottom: 14px;
}

.member-header .brand-icon {
    width: 88px;
    display: block;
    margin: 0 auto 16px;
}

.login-logo {
    font-family: Georgia, serif;
    font-size: 28px;
    letter-spacing: 0.25em;
    color: #C69D7A;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.login-sub {
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #7E94B3;
    text-transform: uppercase;
    margin-bottom: 36px;
}

.field {
    margin-bottom: 16px;
    text-align: right;
}

.field label {
    display: block;
    font-size: 13px;
    color: #B7C4D8;
    margin-bottom: 6px;
}

.field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    border: 1px solid #2A4870;
    background: #0A2144;
    color: #EDE3D6;
    font-size: 14px;
    font-family: inherit;
}

.field input::placeholder {
    color: #5A7195;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 6px;
    border: none;
    background: #C69D7A;
    color: #0A2144;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.btn:hover {
    opacity: 0.88;
}

.btn-outline {
    background: transparent;
    border: 1px solid #C69D7A;
    color: #C69D7A;
}

.btn-small {
    padding: 7px 14px;
    font-size: 12px;
}

.btn-danger {
    background: transparent;
    border: 1px solid #8B3A3A;
    color: #C97A7A;
}

.error-msg {
    color: #D98C8C;
    font-size: 13px;
    margin-top: 10px;
}

/* ---- Member portal ---- */

.member-header {
    background: #0F2C56;
    border-bottom: 1px solid #1B3D6B;
    padding: 28px 0;
    position: relative;
    text-align: center;
}

.member-header .wordmark {
    font-family: Georgia, serif;
    font-size: 22px;
    letter-spacing: 0.22em;
    color: #C69D7A;
    text-transform: uppercase;
}

.member-header .byline {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: #7E94B3;
    text-transform: uppercase;
    margin-top: 2px;
}

.member-header .greeting {
    text-align: center;
}

.member-header .greeting {
    margin-top: 18px;
    font-size: 15px;
    color: #EDE3D6;
}

.stats-row {
    display: flex;
    gap: 16px;
    margin: 28px 0;
    flex-wrap: wrap;
}

.stat-box {
    background: #0F2C56;
    border: 1px solid #1B3D6B;
    border-radius: 8px;
    padding: 20px 24px;
    flex: 1;
    min-width: 140px;
}

.stat-box .stat-value {
    font-size: 26px;
    font-weight: 600;
    color: #C69D7A;
}

.stat-box .stat-label {
    font-size: 12px;
    color: #7E94B3;
    margin-top: 4px;
}

.referral-card {
    background: #0F2C56;
    border: 1px solid #1B3D6B;
    border-radius: 8px;
    padding: 22px 24px;
    margin-bottom: 16px;
}

.referral-card .ref-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.referral-card .ref-name {
    font-size: 16px;
    font-weight: 600;
    color: #EDE3D6;
}

.referral-card .ref-date {
    font-size: 12px;
    color: #7E94B3;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 0.04em;
    background: #1B3D6B;
    color: #B7C4D8;
}

.badge-closed {
    background: #2D5C3E;
    color: #A8D9B8;
}

.badge-pending {
    background: #5C4A2D;
    color: #E8C896;
}

.badge-paid {
    background: #2D5C3E;
    color: #A8D9B8;
}

/* progress tracker */

.progress-track {
    display: flex;
    align-items: center;
    margin: 18px 0 6px;
    overflow-x: auto;
    gap: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 64px;
    position: relative;
}

.progress-step .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #1B3D6B;
    border: 2px solid #2A4870;
    z-index: 2;
}

.progress-step.done .dot {
    background: #C69D7A;
    border-color: #C69D7A;
}

.progress-step .label {
    font-size: 10px;
    color: #7E94B3;
    margin-top: 8px;
    text-align: center;
}

.progress-step.done .label {
    color: #EDE3D6;
}

.progress-line {
    position: absolute;
    top: 6px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: #1B3D6B;
    z-index: 1;
}

.progress-step.done .progress-line {
    background: #C69D7A;
}

.progress-step:first-child .progress-line {
    display: none;
}

.commission-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #1B3D6B;
    font-size: 13px;
    color: #B7C4D8;
}

.commission-row strong {
    color: #C69D7A;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7E94B3;
}

/* ---- Admin dashboard (light theme) ---- */

.admin-topbar {
    background: #0A2144;
    color: #EDE3D6;
    padding: 18px 0;
}

.admin-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-topbar .wordmark {
    font-family: Georgia, serif;
    font-size: 18px;
    letter-spacing: 0.2em;
    color: #C69D7A;
}

.wordmark-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon-small {
    width: 32px;
    height: auto;
}

.admin-body {
    padding: 32px 0 60px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 36px 0 16px;
    color: #1A2332;
}

.card-light {
    background: #FFFFFF;
    border: 1px solid #E3DDD0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
}

.kpi-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.kpi-box {
    background: #FFFFFF;
    border: 1px solid #E3DDD0;
    border-radius: 8px;
    padding: 20px 24px;
    flex: 1;
    min-width: 160px;
}

.kpi-box .kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #104480;
}

.kpi-box .kpi-label {
    font-size: 12px;
    color: #7A7264;
    margin-top: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 13px;
}

table th {
    text-align: right;
    padding: 12px 14px;
    background: #F4F1EC;
    color: #5A5448;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #E3DDD0;
}

table td {
    padding: 12px 14px;
    border-bottom: 1px solid #EFEAE0;
    vertical-align: middle;
}

table tr:last-child td {
    border-bottom: none;
}

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #E3DDD0;
    border-radius: 8px;
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form .field {
    margin-bottom: 0;
    min-width: 140px;
}

.inline-form .field input, .inline-form .field select {
    background: #fff;
    border: 1px solid #D9D2C2;
    color: #1A2332;
}

.link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F4F1EC;
    border: 1px solid #E3DDD0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 11px;
    color: #5A5448;
}

.status-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #D9D2C2;
    font-size: 12px;
    background: #fff;
}

.copy-btn {
    background: none;
    border: none;
    color: #104480;
    cursor: pointer;
    font-size: 11px;
    text-decoration: underline;
}

@media (max-width: 700px) {
    .stats-row, .kpi-row {
        flex-direction: column;
    }
    .progress-step .label {
        display: none;
    }
}
