/**
 * SoCap Profile Services & Authenticated Airwallex Checkout Styles.
 *
 * Styles the profile sidebar offer cards (also shared with the homepage showcase)
 * and the multi-step checkout modal (Account Gate -> Details -> Airwallex Drop-in -> Confirmation).
 *
 * @package SoCap
 */

/* -------------------------------------------------------------------------
   01. CONNECT / OFFERS SIDEBAR CARD
   ---------------------------------------------------------------------- */

.socap-connect {
    display: block;
}

.socap-offer-list {
    display: grid;
    gap: 4px;
    margin-bottom: 12px;
}

.socap-offer-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.socap-offer-card,
.socap-offer-card:last-child {
    margin-bottom: 10px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e4e4e7;
}

.socap-offer-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 6px 16px -10px rgba(124, 58, 237, 0.22);
}

.socap-offer-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.socap-offer-card__type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--socapai-muted, #71717a);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    line-height: 1.3;
    text-transform: uppercase;
}

.socap-offer-icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}

.socap-offer-card__price {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 7px;
    background: #f4f4f5;
    color: var(--socapai-black, #09090b);
    font-size: 0.78rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
    text-align: right;
}

.socap-offer-card__price--free {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: var(--socap-green-hover, #15803d);
}

.socap-offer-card__price-old {
    color: #a1a1aa;
    font-weight: 500;
}

.socap-offer-card__meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.socap-offer-card__desc {
    margin: 0;
    font-size: 0.76rem;
    color: #52525b;
    line-height: 1.4;
}

.socap-offer-card__chip {
    display: inline-flex;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 600;
    color: #52525b;
    background: #f4f4f5;
    padding: 2px 7px;
    border-radius: 999px;
}

.socap-network-vip-badge {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    padding: 8px 11px;
    border: 1px solid var(--socap-green-border, #bbf7d0);
    border-radius: 10px;
    background: var(--socap-green-subtle, #f0fdf4);
    color: var(--socap-green-hover, #15803d);
    font-size: 0.74rem;
    font-weight: 650;
    line-height: 1.35;
}

.socap-network-vip-badge__icon {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.socap-offer-card .socap-btn {
    min-height: 40px;
    margin-top: 0;
    padding: 9px 12px;
    font-size: 0.78rem;
}

.socap-offer-button__icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}

.socap-offer-card .socap-btn-secondary {
    border-width: 1px;
}

.socap-connect-note {
    font-size: 0.72rem;
    color: var(--socapai-muted, #71717a);
    text-align: center;
    margin: 10px 0 0;
    line-height: 1.45;
}

.socap-note-sub {
    display: block;
    font-size: 0.69rem;
}

.socap-note-trust {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.socap-trust-icon {
    width: 13px;
    height: 13px;
    color: #16a34a;
    flex: 0 0 auto;
}

.socap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.socap-btn-primary {
    background: linear-gradient(135deg, #251f3b 0%, #141221 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.socap-btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: #ffffff;
}

.socap-btn-secondary {
    background: #ffffff;
    color: var(--socapai-black, #09090b);
    border: 1px solid #d4d4d8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.socap-btn-secondary:hover {
    background: var(--socapai-black, #09090b);
    border-color: var(--socapai-black, #09090b);
    color: #ffffff;
}

.socap-btn-arrow {
    transition: transform 0.18s ease;
}

.socap-btn:hover .socap-btn-arrow {
    transform: translateX(3px);
}

/* Status Notices */

.socap-connect-notice {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    line-height: 1.45;
}

.socap-connect-notice.is-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.socap-connect-notice.is-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.socap-connect-notice.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.socap-notice-ref {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.74rem;
}

/* -------------------------------------------------------------------------
   02. STICKY SIDEBAR BEHAVIOUR (desktop)
   ---------------------------------------------------------------------- */

@media (min-width: 992px) {
    .profile-sidebar.profile-card-header {
        position: static;
    }

    .socap-connect {
        position: sticky;
        top: 76px;
        z-index: 30;
    }
}

@media (max-width: 991px) {
    .socap-connect {
        margin: 18px 0;
    }
}

/* -------------------------------------------------------------------------
   03. MULTI-STEP CHECKOUT MODAL
   ---------------------------------------------------------------------- */

.socap-modal {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.socap-modal.is-open {
    display: flex;
}

/* Ensure HTML hidden attribute always overrides flex/grid author rules inside the checkout modal */
.socap-modal [hidden] {
    display: none !important;
}

.socap-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 9, 11, 0.6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.socap-modal-panel {
    position: relative;
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 24px 24px 22px;
    box-shadow: 0 28px 64px -20px rgba(0, 0, 0, 0.48);
    animation: socapModalIn 0.22s ease;
}

@keyframes socapModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.socap-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f4f4f5;
    color: #52525b;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.socap-modal-close:hover {
    background: #e4e4e7;
    color: #09090b;
}

body.socap-modal-open {
    overflow: hidden;
}

/* Expert & Step Header */

.socap-co-header {
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f0f0f3;
}

.socap-co-expert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 36px;
}

.socap-co-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    background: #18181b;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.socap-co-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.socap-co-expert-meta {
    min-width: 0;
    flex: 1;
}

.socap-co-expert-name {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.95rem;
    color: #09090b;
}

.socap-co-service-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: 0.82rem;
    color: #52525b;
}

.socap-co-price-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f5f3ff;
    color: #6d28d9;
    font-weight: 700;
    font-size: 0.76rem;
    font-variant-numeric: tabular-nums;
}

.socap-co-steps {
    display: flex;
    align-items: center;
    gap: 14px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.socap-co-steps li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #a1a1aa;
}

.socap-co-steps li span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    background: #f4f4f5;
    color: #71717a;
}

.socap-co-steps li.is-active {
    color: #09090b;
}

.socap-co-steps li.is-active span {
    background: #7c3aed;
    color: #ffffff;
}

.socap-co-steps li.is-done {
    color: #15803d;
}

.socap-co-steps li.is-done span {
    background: #dcfce7;
    color: #15803d;
}

/* Auth Stage */

.socap-co-auth-intro h3 {
    margin: 0 0 4px;
    font-size: 1.08rem;
    font-weight: 750;
    color: #09090b;
}

.socap-co-auth-intro p {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: #71717a;
    line-height: 1.45;
}

.socap-co-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    border-radius: 11px;
    background: #f4f4f5;
    margin-bottom: 16px;
}

.socap-co-tab {
    border: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.82rem;
    font-weight: 650;
    color: #52525b;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.socap-co-tab.is-active {
    background: #ffffff;
    color: #09090b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Details Stage */

.socap-co-signed-in {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 10px;
    background: #fafafa;
    border: 1px solid #e4e4e7;
    font-size: 0.76rem;
    color: #52525b;
    margin-bottom: 14px;
}

.socap-co-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    flex: 0 0 auto;
}

.socap-co-offer-info {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-bottom: 14px;
}

.socap-co-offer-info p {
    margin: 0 0 6px;
    font-size: 0.8rem;
    color: #334155;
    line-height: 1.45;
}

.socap-co-offer-info p:last-child {
    margin-bottom: 0;
}

.socap-co-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.socap-co-chips span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 999px;
}

/* Flexible Support Presets */

.socap-co-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.socap-co-preset {
    padding: 8px 6px;
    border-radius: 9px;
    border: 1px solid #d4d4d8;
    background: #ffffff;
    font-size: 0.84rem;
    font-weight: 700;
    color: #18181b;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s ease;
}

.socap-co-preset.is-selected,
.socap-co-preset:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
    color: #6d28d9;
}

.socap-co-amount-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 0 12px;
    background: #ffffff;
}

.socap-co-amount-input-wrap input {
    border: none !important;
    box-shadow: none !important;
    padding: 10px 8px !important;
    font-weight: 700;
    flex: 1;
}

.socap-co-amount-sym,
.socap-co-amount-cur {
    font-size: 0.84rem;
    font-weight: 650;
    color: #71717a;
}

/* Forms */

.socap-contact-form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.socap-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.socap-field-row {
    display: flex;
    gap: 12px;
}

.socap-field-row .socap-field {
    flex: 1;
    min-width: 0;
}

.socap-field-label {
    font-size: 0.79rem;
    font-weight: 650;
    color: #18181b;
}

.socap-field-label--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.socap-co-forgot {
    font-size: 0.74rem;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
}

.socap-co-forgot:hover {
    text-decoration: underline;
}

.socap-field-label em {
    color: #7c3aed;
    font-style: normal;
}

.socap-optional {
    color: #a1a1aa;
    font-weight: 500;
}

.socap-field input[type="text"],
.socap-field input[type="email"],
.socap-field input[type="password"],
.socap-field input[type="url"],
.socap-field input[type="date"],
.socap-field input[type="number"],
.socap-field textarea {
    width: 100%;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: #09090b;
    background: #ffffff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.socap-field textarea {
    resize: vertical;
    min-height: 92px;
}

.socap-field input:focus,
.socap-field textarea:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.16);
}

.socap-consent {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.79rem;
    color: #52525b;
    line-height: 1.45;
    cursor: pointer;
}

.socap-consent input {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex: none;
    accent-color: #7c3aed;
}

.socap-consent a {
    color: #09090b;
    text-decoration: underline;
}

/* Order Summary Box */

.socap-co-summary {
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    background: #fafafa;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.socap-co-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #52525b;
}

.socap-co-summary-total {
    padding-top: 8px;
    border-top: 1px solid #e4e4e7;
    font-size: 0.92rem;
    font-weight: 700;
    color: #09090b;
}

.socap-co-protection {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    font-size: 0.74rem;
    line-height: 1.4;
}

.socap-co-protection-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
}

/* Airwallex Payment Stage */

.socap-co-pay-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f3;
}

.socap-co-back {
    border: none;
    background: transparent;
    padding: 4px 0;
    font-size: 0.8rem;
    font-weight: 650;
    color: #52525b;
    cursor: pointer;
    font-family: inherit;
}

.socap-co-back:hover {
    color: #09090b;
}

.socap-co-pay-total {
    text-align: right;
    font-size: 0.92rem;
    color: #09090b;
}

.socap-co-order-ref {
    display: block;
    font-size: 0.68rem;
    font-family: ui-monospace, Consolas, monospace;
    color: #71717a;
}

.socap-co-dropin-shell {
    position: relative;
    min-height: 220px;
    border: 1px solid #e4e4e7;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.socap-co-dropin-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 42px 16px;
    font-size: 0.82rem;
    color: #71717a;
}

.socap-co-spinner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid #e4e4e7;
    border-top-color: #7c3aed;
    animation: socapSpin 0.75s linear infinite;
}

@keyframes socapSpin {
    to {
        transform: rotate(360deg);
    }
}

.socap-co-security-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #71717a;
    margin: 14px 0 0;
}

.socap-co-lock-icon {
    width: 13px;
    height: 13px;
}

/* Feedback & Loading */

.socap-submit.is-loading {
    opacity: 0.68;
    pointer-events: none;
}

.socap-form-feedback {
    margin: 4px 0 0;
    font-size: 0.82rem;
    line-height: 1.4;
}

.socap-form-feedback.is-error {
    color: #dc2626;
}

.socap-form-feedback.is-success {
    color: #15803d;
}

/* Success Stage */

.socap-form-success {
    text-align: center;
    padding: 8px 4px 4px;
}

.socap-form-success .socap-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.socap-form-success h4 {
    font-size: 1.15rem;
    margin: 0 0 8px;
    color: #09090b;
}

.socap-form-success p {
    font-size: 0.88rem;
    color: #52525b;
    margin: 0;
    line-height: 1.55;
}

.socap-co-receipt-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f4f4f5;
    font-size: 0.78rem;
    color: #27272a;
}

.socap-co-success-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

/* -------------------------------------------------------------------------
   04. RESPONSIVE
   ---------------------------------------------------------------------- */

@media (max-width: 560px) {
    .socap-field-row {
        flex-direction: column;
        gap: 12px;
    }

    .socap-modal {
        padding: 10px;
    }

    .socap-modal-panel {
        padding: 20px 16px 18px;
        border-radius: 16px;
    }

    .socap-co-steps {
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .socap-modal-panel,
    .socap-co-spinner {
        animation: none;
    }

    .socap-btn,
    .socap-btn-arrow {
        transition: none;
    }
}
