/* CSS Architecture — Dhadi Community Platform */

:root {
    /* Refined Brand Palette — Elegant & Deep */
    --primary-deep: #002347;       /* Deep Midnight Blue */
    --primary-royal: #003a70;      /* Sophisticated Royal Blue */
    --primary-soft: #e6f0ff;       /* Light Blue Mist */
    
    --gold-vibrant: #ffc107;       /* Rich Mustard Gold */
    --gold-muted: #fff8e1;         /* Soft Cream Gold */
    --gold-gradient: linear-gradient(135deg, #ffc107 0%, #ffde59 100%);

    --slate-text: #1a202c;         /* Readable Slate */
    --slate-muted: #4a5568;        /* Soft Grays for hierarchy */
    
    --bg-canvas: #fdfdfd;          /* Off-white canvas to reduce strain */
    --white: #ffffff;
    
    /* Elegant Spacing & Depth */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-soft: 0 10px 15px -3px rgba(0, 35, 71, 0.05), 0 4px 6px -2px rgba(0, 35, 71, 0.03);
    --shadow-elevated: 0 20px 25px -5px rgba(0, 35, 71, 0.1), 0 10px 10px -5px rgba(0, 35, 71, 0.04);
    
    /* Typography Overhaul */
    --font-main: 'Outfit', 'Inter', system-ui, sans-serif;
    --font-telugu: 'Noto Sans Telugu', serif;
}

.bg-canvas { background-color: var(--bg-canvas); }

body {
    font-family: var(--font-main);
    color: var(--slate-text);
    background-color: var(--bg-canvas);
    line-height: 1.7; /* Increased for better readability */
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em; /* Special touch for modern fonts */
}

/* Eye-pleasing typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--primary-deep);
    letter-spacing: -0.02em;
}

/* Allow .text-white to override heading color on dark backgrounds */
h1.text-white, h2.text-white, h3.text-white,
h4.text-white, h5.text-white, h6.text-white,
.text-white h1, .text-white h2, .text-white h3,
.text-white h4, .text-white h5, .text-white h6 {
    color: #ffffff !important;
}

.text-gold-gradient {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Custom Navigation — Glassmorphism Effect */
.navbar-custom {
    background: rgba(0, 35, 71, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.05rem;
    font-weight: 700;
    line-height: 1.75rem;
}

/* Premium Buttons */
.btn-premium {
    background: var(--gold-gradient);
    color: var(--primary-deep);
    border: none;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-premium:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-elevated);
    color: var(--primary-deep);
}

.btn-premium-outline {
    background: transparent;
    border: 2px solid var(--primary-royal);
    color: var(--primary-royal);
    font-weight: 600;
    padding: 0.7rem 2rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.btn-premium-outline:hover {
    background: var(--primary-royal);
    color: var(--white);
}

/* Special Cards — Soft Elevation */
.card-elegant {
    border: none;
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-soft);
    padding: 0.45rem 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid transparent;
}

.card-elegant:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-elevated);
    border-top: 4px solid var(--gold-vibrant);
}

.initiative-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--primary-royal);
}

/* Hero Enhancements */
.hero-wrapper {
    background: radial-gradient(circle at top right, var(--primary-soft) 0%, var(--bg-canvas) 60%);
    overflow: hidden;
}

.hero-image-container img {
    border-radius: var(--radius-md);
    transition: transform 0.5s ease;
}

.hero-image-container:hover img {
    transform: rotate(-1deg) scale(1.02);
}

/* Footer Design — Deep & Minimal */
.footer-custom {
    background-color: var(--primary-deep);
    border-top: 4px solid var(--gold-vibrant);
}

.hover-white:hover {
    color: var(--white) !important;
    transition: color 0.3s ease;
}

.rounded-custom {
    border-radius: var(--radius-md);
}

/* Ad Placeholders — Elegant Variant */
.ad-slot {
    background: var(--primary-soft);
    border: 2px dashed var(--primary-royal);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
    margin: 1.5rem 0;
    color: var(--primary-royal);
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Micro-animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

.bg-gold-muted {
    background-color: var(--gold-muted);
}

/* Background utilities */
.bg-gold-vibrant {
    background-color: var(--gold-vibrant) !important;
}

.bg-primary-deep {
    background-color: var(--primary-deep) !important;
}

.bg-primary-soft {
    background-color: var(--primary-soft) !important;
}

/* Text color utilities */
.text-primary-deep {
    color: var(--primary-deep) !important;
}

.text-primary-royal {
    color: var(--primary-royal) !important;
}

.text-gold-vibrant {
    color: var(--gold-vibrant) !important;
}

.text-slate-muted {
    color: var(--slate-muted) !important;
}

.text-slate-text {
    color: var(--slate-text) !important;
}

/* Shadow utility */
.shadow-soft {
    box-shadow: var(--shadow-soft) !important;
}

.shadow-elevated {
    box-shadow: var(--shadow-elevated) !important;
}

.bg-white {
    background-color: var(--white) !important;
}

/* Soft icon-chip background utilities — referenced by the member dashboard's Quick
   Actions and status icons but never actually defined before, so those icons rendered
   with no background at all. */
.bg-danger-soft  { background-color: #fde8ea !important; }
.bg-success-soft { background-color: #e3f7ea !important; }
.bg-warning-soft { background-color: #fff4de !important; }
.bg-info-soft    { background-color: #e8f0fe !important; }
.bg-purple-soft  { background-color: #f1e7fc !important; }
.text-purple     { color: #7c3aed !important; }

/* ── Member dashboard overview ───────────────────────────────────────────── */
.quick-action-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: inherit;
    height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.quick-action-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
    color: inherit;
}
.quick-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.05rem;
}

.service-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0.25rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}
.service-row:hover { background: var(--bg-canvas); color: inherit; }
.service-row + .service-row { border-top: 1px solid #eef1f5; }
.service-row-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-item { display: flex; gap: 0.85rem; padding: 0.8rem 0.25rem; }
.activity-item + .activity-item { border-top: 1px solid #eef1f5; }
.activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.invite-banner {
    background: var(--primary-soft);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

/* Bootstrap ships responsive spacing/display utilities but not responsive border
   utilities — used to divide the dashboard status bar's segments on wide screens only. */
@media (min-width: 992px) {
    .border-lg-end { border-right: 1px solid #eef1f5; }
}

/* ── Field sizing parity: every "rounded-custom" field (text input, textarea, date,
   file, password, AND TomSelect-enhanced select) renders at the same control height and
   pill styling, so a form never looks "assembled from different components". TomSelect
   replaces the <select> with a sibling .ts-wrapper carrying its own default sizing —
   this re-styles that wrapper to match the plain inputs beside it. Scoped to
   `select.rounded-custom` only (the public/dashboard soft-pill style), never touching the
   compact admin-panel selects, which don't carry that class. ── */
.rounded-custom.form-control,
.rounded-custom.form-select {
    min-height: 56px;
}
select.rounded-custom + .ts-wrapper .ts-control {
    background-color: var(--primary-soft) !important;
    border: none !important;
    border-radius: var(--radius-md) !important;
    padding: 0.8rem 1rem !important;
    min-height: 56px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}
select.rounded-custom + .ts-wrapper .ts-control > * {
    font-size: 1rem;
    color: var(--slate-text);
}
select.rounded-custom + .ts-wrapper.focus .ts-control {
    box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.15) !important;
}
select.rounded-custom + .ts-wrapper .ts-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-elevated);
    margin-top: 4px;
}
select.rounded-custom + .ts-wrapper .ts-dropdown .option.active {
    background-color: var(--primary-soft);
    color: var(--primary-deep);
}
/* Locked (not disabled) TomSelect — value still POSTs with the form, but the control reads
   as read-only. Used for fields like Gender once it's implied by the chosen Relationship. */
select.rounded-custom + .ts-wrapper.locked .ts-control {
    cursor: not-allowed;
    background-color: #e9edf2 !important;
    color: var(--slate-muted);
}
select.rounded-custom + .ts-wrapper.locked .ts-control > * {
    color: var(--slate-muted);
}

/* ── Sectioned wizard card — shared by all 3 registration steps (Personal Details /
   Family Details / Payment) so they read as one continuous, consistently-built flow
   rather than three separately-styled pages. ── */
.reg-form-card {
    display: block;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    overflow: hidden;
}
.reg-section-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    padding: 1.35rem 2rem;
    border-bottom: 1px solid var(--primary-soft);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary-royal);
    flex-direction: row;
    flex-wrap: balance;
    align-content: flex-start;
}
.reg-section-header > span:first-child,
.reg-section-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.reg-section-header i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.reg-section {
    padding: 1.5rem 2rem 1.75rem;
    border-bottom: 1px solid #f1f5f9;
}
.reg-section:last-of-type {
    border-bottom: none;
}
.reg-form-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
}

/* ── Membership family plan: count stepper, people strip, selectable tier cards ── */
.member-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--primary-soft);
    border-radius: 999px;
}
.member-stepper button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--white);
    color: var(--primary-royal);
    box-shadow: 0 1px 3px rgba(0, 35, 71, 0.12);
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.member-stepper button:hover:not(:disabled) { background: var(--primary-royal); color: var(--white); }
.member-stepper button:active:not(:disabled) { transform: scale(0.92); }
.member-stepper button:disabled { opacity: 0.35; box-shadow: none; cursor: not-allowed; }
.member-stepper input {
    width: 56px;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-deep);
    -moz-appearance: textfield;
    appearance: textfield;
}
.member-stepper input::-webkit-outer-spin-button,
.member-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.member-stepper input:focus { outline: none; }
.member-stepper:focus-within { box-shadow: 0 0 0 3px rgba(0, 58, 112, 0.15); }

.people-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 1.5rem 0 1.25rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
}
.person-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px dashed #cbd5e1;
    color: #cbd5e1;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.person-dot.is-you { background: var(--gold-gradient); border: 0; color: var(--primary-deep); }
.person-dot.is-on  { background: var(--primary-royal); border: 0; color: var(--white); transform: scale(1.08); }
.people-divider { width: 2px; height: 22px; margin: 0 4px; background: #cbd5e1; border-radius: 2px; }
.people-count { font-size: 0.9rem; font-weight: 600; color: var(--primary-deep); }

.plan-tier {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 1.15rem 1.25rem;
    text-align: left;
    background: var(--white);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.plan-tier:hover { border-color: #a9c4ea; }
.plan-tier:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 58, 112, 0.2); }
.plan-tier[aria-pressed="true"] {
    border-color: var(--primary-royal);
    background: linear-gradient(180deg, #f2f7ff 0%, var(--white) 100%);
    box-shadow: 0 8px 20px -8px rgba(0, 58, 112, 0.35);
}
.plan-tier-check {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: transparent;
    transition: all 0.2s ease;
}
.plan-tier[aria-pressed="true"] .plan-tier-check { background: var(--primary-royal); border-color: var(--primary-royal); color: var(--white); }
.plan-tier-name  { font-size: 0.9rem; font-weight: 600; color: var(--slate-muted); padding-right: 2rem; }
.plan-tier-price { font-size: 2rem; font-weight: 800; line-height: 1.2; color: var(--primary-deep); margin: 0.15rem 0 0.35rem; }
.plan-tier-meta  { font-size: 0.8rem; color: var(--slate-muted); }

.plan-hint {
    display: flex;
    gap: 0.6rem;
    margin: 1.25rem 0 0;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #7a5b00;
    background: var(--gold-muted);
    border-radius: var(--radius-sm);
}
.plan-hint i { margin-top: 0.2rem; color: #d49b00; }

@media (max-width: 575.98px) {
    .member-stepper { width: 100%; justify-content: space-between; }
    .member-stepper input { flex: 1; }
    .people-strip { gap: 4px; padding: 0.75rem; }
    .person-dot { width: 22px; height: 22px; font-size: 0.6rem; border-width: 1.5px; }
    .people-divider { margin: 0 2px; }
    .people-count { width: 100%; margin-left: 0 !important; }
    .plan-tier-price { font-size: 1.75rem; }
}

@media (max-width: 575.98px) {
    .reg-section-header,
    .reg-section,
    .reg-form-footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}