/* Material Design 3 — Escrow surfaces */

.md-escrow-page {
    --md-escrow-radius: 16px;
    --md-escrow-radius-sm: 12px;
    --md-escrow-elevation-1: 0 1px 2px rgba(38, 50, 56, .12), 0 1px 3px rgba(38, 50, 56, .08);
    --md-escrow-elevation-2: 0 2px 6px rgba(38, 50, 56, .12), 0 4px 12px rgba(38, 50, 56, .08);
    --md-escrow-elevation-3: 0 6px 16px rgba(21, 101, 192, .14), 0 2px 6px rgba(38, 50, 56, .08);
}

.md-escrow-header {
    margin-bottom: 24px;
}

.md-escrow-header__title {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.md-escrow-header__icon {
    align-items: center;
    background: rgba(21, 101, 192, .12);
    border-radius: 14px;
    color: var(--ss-primary);
    display: inline-flex;
    font-size: 22px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.md-escrow-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 24px;
}

.md-escrow-stat {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: var(--md-escrow-radius);
    box-shadow: var(--md-escrow-elevation-1);
    display: flex;
    gap: 16px;
    padding: 18px 20px;
    transition: box-shadow .2s ease, transform .2s ease;
}

.md-escrow-stat:hover {
    box-shadow: var(--md-escrow-elevation-2);
    transform: translateY(-1px);
}

.md-escrow-stat__icon {
    align-items: center;
    border-radius: 12px;
    color: #fff;
    display: inline-flex;
    flex-shrink: 0;
    font-size: 20px;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.md-escrow-stat__icon--held { background: var(--ss-accent); color: #263238; }
.md-escrow-stat__icon--released { background: var(--ss-success); }
.md-escrow-stat__icon--refunded { background: var(--ss-info); }
.md-escrow-stat__icon--active { background: var(--ss-primary); }

.md-escrow-stat__label {
    color: var(--ss-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.md-escrow-stat__value {
    color: var(--ss-heading);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.1;
    margin: 0;
}

.md-escrow-stat__currency {
    color: var(--ss-muted);
    font-size: .95rem;
    font-weight: 500;
    margin-right: 4px;
}

.md-escrow-surface {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: var(--md-escrow-radius);
    box-shadow: var(--md-escrow-elevation-1);
    overflow: hidden;
}

.md-escrow-surface__header {
    align-items: center;
    border-bottom: 1px solid var(--ss-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 18px 22px;
}

.md-escrow-surface__title {
    color: var(--ss-heading);
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.md-escrow-surface__body {
    padding: 22px;
}

.md-escrow-filter {
    margin-bottom: 24px;
}

.md-escrow-filter .form-control,
.md-escrow-filter .form-select {
    border-color: #ebedf2;
    border-radius: 0;
    border-width: 2px;
    min-height: auto;
    padding: 0.6rem 1rem;
}

.md-escrow-filter .btn-primary {
    min-height: auto;
    padding: 0.6rem 1.25rem;
}

.md-escrow-list {
    display: grid;
    gap: 12px;
}

.md-escrow-item {
    align-items: center;
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: var(--md-escrow-radius);
    box-shadow: var(--md-escrow-elevation-1);
    color: inherit;
    display: grid;
    gap: 16px;
    grid-template-columns: auto 1fr auto auto;
    padding: 16px 18px;
    text-decoration: none;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}

.md-escrow-item:hover,
.md-escrow-item:focus {
    background: rgba(21, 101, 192, .03);
    box-shadow: var(--md-escrow-elevation-2);
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
}

.md-escrow-item__leading {
    align-items: center;
    background: rgba(249, 168, 37, .16);
    border-radius: 14px;
    color: #E65100;
    display: inline-flex;
    font-size: 20px;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.md-escrow-item__leading--released {
    background: rgba(76, 175, 80, .14);
    color: var(--ss-secondary-dark);
}

.md-escrow-item__leading--refunded {
    background: rgba(33, 150, 243, .14);
    color: #0D47A1;
}

.md-escrow-item__leading--disputed {
    background: rgba(229, 57, 53, .12);
    color: #B71C1C;
}

.md-escrow-item__title {
    color: var(--ss-heading);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 4px;
}

.md-escrow-item__meta,
.md-escrow-item__parties {
    color: var(--ss-muted);
    font-size: .9rem;
    margin: 0;
}

.md-escrow-item__amount {
    color: var(--ss-heading);
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.md-escrow-item__amount span {
    color: var(--ss-muted);
    font-weight: 500;
}

.md-escrow-trust-hero {
    background: #ffffff;
    border: 1px solid var(--ss-border);
    border-radius: var(--md-escrow-radius);
    box-shadow: var(--md-escrow-elevation-2);
    margin-bottom: 24px;
    overflow: hidden;
    padding: 24px;
}

.md-escrow-trust-hero__top {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.md-escrow-trust-hero__shield {
    align-items: center;
    background: var(--ss-primary);
    border-radius: 18px;
    box-shadow: var(--md-escrow-elevation-3);
    color: #fff;
    display: inline-flex;
    font-size: 28px;
    height: 64px;
    justify-content: center;
    width: 64px;
}

.md-escrow-trust-hero__headline {
    color: var(--ss-heading);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -.03em;
    margin: 0 0 6px;
}

.md-escrow-trust-hero__copy {
    color: var(--ss-muted);
    margin: 0;
    max-width: 640px;
}

.md-escrow-trust-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.md-escrow-trust-field {
    background: var(--ss-surface);
    border: 1px solid var(--ss-border);
    border-radius: var(--md-escrow-radius-sm);
    padding: 14px 16px;
}

.md-escrow-trust-field__label {
    color: var(--ss-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.md-escrow-trust-field__value {
    color: var(--ss-heading);
    font-size: .98rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.md-escrow-progress-group {
    display: grid;
    gap: 14px;
}

.md-escrow-progress {
    background: var(--ss-bg);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.md-escrow-progress__bar {
    border-radius: 999px;
    height: 100%;
    transition: width .3s ease;
}

.md-escrow-progress__bar--held { background: var(--ss-accent); }
.md-escrow-progress__bar--released { background: var(--ss-success); }
.md-escrow-progress__bar--refunded { background: var(--ss-info); }

.md-escrow-progress-meta {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.md-escrow-progress-meta span {
    color: var(--ss-muted);
    font-size: .85rem;
    font-weight: 600;
}

.md-escrow-progress-meta strong {
    color: var(--ss-heading);
    font-size: .9rem;
}

.md-escrow-stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 0;
    justify-content: space-between;
    position: relative;
}

.md-escrow-stepper::before {
    background: var(--ss-border);
    content: "";
    height: 2px;
    left: 8%;
    position: absolute;
    right: 8%;
    top: 22px;
    z-index: 0;
}

.md-escrow-step {
    flex: 1 1 120px;
    position: relative;
    text-align: center;
    z-index: 1;
}

.md-escrow-step__dot {
    align-items: center;
    background: var(--ss-bg);
    border: 2px solid var(--ss-border);
    border-radius: 999px;
    color: var(--ss-muted);
    display: inline-flex;
    font-size: 14px;
    height: 44px;
    justify-content: center;
    margin-bottom: 10px;
    width: 44px;
}

.md-escrow-step--complete .md-escrow-step__dot {
    background: var(--ss-primary);
    border-color: var(--ss-primary);
    color: #fff;
}

.md-escrow-step--current .md-escrow-step__dot {
    background: rgba(249, 168, 37, .18);
    border-color: var(--ss-accent);
    color: #E65100;
}

.md-escrow-step__label {
    color: var(--ss-muted);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 0 6px;
}

.md-escrow-step--complete .md-escrow-step__label,
.md-escrow-step--current .md-escrow-step__label {
    color: var(--ss-heading);
}

.md-escrow-action {
    border-radius: var(--md-escrow-radius);
    box-shadow: var(--md-escrow-elevation-1);
    height: 100%;
    overflow: hidden;
}

.md-escrow-action--release {
    border: 1px solid rgba(46, 125, 50, .22);
}

.md-escrow-action--refund {
    border: 1px solid rgba(229, 57, 53, .22);
}

.md-escrow-action__header {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 18px 22px;
}

.md-escrow-action--release .md-escrow-action__header {
    background: rgba(76, 175, 80, .1);
}

.md-escrow-action--refund .md-escrow-action__header {
    background: rgba(229, 57, 53, .08);
}

.md-escrow-action__header i {
    font-size: 18px;
}

.md-escrow-action--release .md-escrow-action__header i { color: var(--ss-secondary); }
.md-escrow-action--refund .md-escrow-action__header i { color: var(--ss-danger); }

.md-escrow-action__body {
    background: var(--ss-surface);
    padding: 22px;
}

.md-escrow-action .form-control {
    border-color: #ebedf2;
    border-radius: 0;
    border-width: 2px;
    padding: 0.6rem 1rem;
}

.md-escrow-btn {
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    min-height: 44px;
    padding: 0 22px;
    transition: box-shadow .2s ease, transform .2s ease;
}

.md-escrow-btn:hover {
    transform: translateY(-1px);
}

.md-escrow-btn--filled-primary {
    background: var(--ss-primary);
    box-shadow: 0 2px 8px rgba(21, 101, 192, .24);
    color: #fff;
}

.md-escrow-btn--filled-danger {
    background: var(--ss-danger);
    box-shadow: 0 2px 8px rgba(229, 57, 53, .22);
    color: #fff;
}

.md-escrow-btn--tonal {
    background: rgba(21, 101, 192, .12);
    color: var(--ss-primary);
}

.md-escrow-empty {
    color: var(--ss-muted);
    padding: 48px 24px;
    text-align: center;
}

.md-escrow-empty i {
    color: var(--ss-primary);
    font-size: 42px;
    margin-bottom: 12px;
    opacity: .65;
}

@media (max-width: 991.98px) {
    .md-escrow-item {
        grid-template-columns: auto 1fr;
    }

    .md-escrow-item__amount,
    .md-escrow-item .status-pill {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }

    .md-escrow-stepper::before {
        display: none;
    }
}
