/*
 * Finachub checkout UI
 * Minimal frontend styling for checkout and waiting screens.
 */

.finachub-mm-checkout-wrapper,
body.mm-waiting-body {
    --mm-bg: #f4f7fb;
    --mm-surface: #ffffff;
    --mm-surface-muted: #f8fafc;
    --mm-border: #dbe4ef;
    --mm-border-strong: #c4d0de;
    --mm-text: #0f172a;
    --mm-text-muted: #64748b;
    --mm-accent: #0f766e;
    --mm-accent-strong: #115e59;
    --mm-accent-soft: #ccfbf1;
    --mm-success: #16a34a;
    --mm-shadow: 0 20px 44px rgba(15, 23, 42, 0.08);
    --mm-shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.06);
    --mm-radius-lg: 24px;
    --mm-radius-md: 18px;
    --mm-radius-sm: 14px;
}

.finachub-mm-checkout-wrapper,
.mm-waiting-container {
    box-sizing: border-box;
    font-family: 'Jost', sans-serif;
}

.finachub-mm-checkout-wrapper *,
.mm-waiting-container * {
    box-sizing: inherit;
}

.woocommerce-checkout .finachub-mm-checkout-wrapper.compact {
    width: 100%;
    margin: 18px 0 10px;
    padding: 26px;
    border: 1px solid rgba(196, 208, 222, 0.75);
    border-radius: var(--mm-radius-lg);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 20rem),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    box-shadow: var(--mm-shadow);
}

.mm-checkout-header {
    margin-bottom: 14px;
}

.mm-checkout-kicker {
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--mm-accent-soft);
    color: var(--mm-accent-strong);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.mm-checkout-title {
    margin: 0 0 8px;
    color: var(--mm-text);
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.mm-checkout-copy {
    margin: 0;
    max-width: 38rem;
    color: var(--mm-text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.finachub-provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.finachub-mm-checkout-wrapper .finachub-provider-item input[type="radio"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.finachub-provider-item {
    position: relative;
    display: grid;
    justify-items: start;
    gap: 10px;
    min-height: 124px;
    padding: 18px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius-md);
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    transition: 180ms ease;
}

.finachub-provider-item:hover {
    border-color: var(--mm-border-strong);
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--mm-shadow-soft);
}

.finachub-provider-item.active {
    border-color: rgba(15, 118, 110, 0.38);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.09);
}

.finachub-provider-item::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 16px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--mm-accent);
    opacity: 0;
    transform: scale(0.7);
    transition: 180ms ease;
}

.finachub-provider-item.active::after {
    opacity: 1;
    transform: scale(1);
}

.mm-provider-logo-wrap {
    display: flex;
    align-items: center;
    height: 24px;
}

.mm-provider-logo-wrap img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.72;
    transition: 180ms ease;
}

.finachub-provider-item.active .mm-provider-logo-wrap img {
    filter: grayscale(0%);
    opacity: 1;
}

.finachub-provider-name {
    color: var(--mm-text);
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.mm-provider-meta {
    color: var(--mm-text-muted);
    font-size: 12px;
    font-weight: 500;
}

.finachub-mm-field {
    margin-top: 8px;
}

.mm-input-label {
    display: block;
    margin-bottom: 10px;
    color: var(--mm-text);
    font-size: 13px;
    font-weight: 650;
}

.mm-input-wrapper {
    position: relative;
}

.mm-input-prefix {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--mm-text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    white-space: nowrap;
}

.mm-input-wrapper input {
    width: 100%;
    max-width: 100%;
    min-height: 58px;
    margin: 0;
    padding: 0 18px 0 110px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius-md);
    background: rgba(255, 255, 255, 0.92);
    color: var(--mm-text);
    font-size: 16px;
    line-height: 1.4;
    transition: 180ms ease;
}

.mm-input-wrapper input::placeholder {
    color: #94a3b8;
}

.mm-input-wrapper input:focus {
    border-color: rgba(15, 118, 110, 0.52);
    outline: none;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
    background: #ffffff;
}

.mm-field-help {
    margin: 10px 0 0;
    color: var(--mm-text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.mm-checkout-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(219, 228, 239, 0.9);
}

.mm-secure-badge,
.mm-footer-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mm-text-muted);
    font-size: 12px;
    font-weight: 600;
}

.mm-secure-badge .dashicons {
    color: var(--mm-success);
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ---------------------------------------------------------
 * Payment Method — logos pill next to the title
 * --------------------------------------------------------- */
.mm-gateway-title-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    vertical-align: middle;
}

.mm-title-logos {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border: 1px solid #dbe4ef;
    border-radius: 8px;
    background: #f8fafc;
    line-height: 0;
    vertical-align: middle;
}

.mm-title-logo {
    display: inline-block !important;
    height: 20px !important;
    max-height: 20px !important;
    width: auto !important;
    max-width: 54px !important;
    object-fit: contain !important;
    vertical-align: middle;
    flex-shrink: 0;
}

body.mm-waiting-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 20rem),
        linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.mm-waiting-container {
    width: 100%;
    max-width: 460px;
    padding: 34px 30px 28px;
    border: 1px solid rgba(196, 208, 222, 0.75);
    border-radius: var(--mm-radius-lg);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--mm-shadow);
    text-align: center;
}

.mm-waiting-logo {
    width: auto;
    height: 34px;
    margin-bottom: 26px;
}

.mm-status-card {
    padding: 24px 18px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius-md);
    background: var(--mm-surface-muted);
}

.mm-waiting-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    animation: mm-rotate 1.5s linear infinite;
}

.mm-waiting-spinner circle {
    fill: none;
    stroke: var(--mm-accent);
    stroke-width: 3.5;
    stroke-dasharray: 100, 150;
    stroke-linecap: round;
}

@keyframes mm-rotate {
    100% {
        transform: rotate(360deg);
    }
}

.mm-status-card h2 {
    margin: 0 0 8px;
    color: var(--mm-text);
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.mm-instruction {
    margin: 0;
    color: var(--mm-text-muted);
    font-size: 14px;
    line-height: 1.7;
}

.mm-countdown-text {
    margin: 10px 0 0;
    color: var(--mm-text-muted);
    font-size: 12px;
}

.mm-countdown-text #mm-countdown {
    font-weight: 700;
    color: var(--mm-accent);
}

.mm-manual-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0;
    padding: 14px 16px;
    border: 1px solid rgba(15, 118, 110, 0.15);
    border-radius: var(--mm-radius-sm);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
    text-align: left;
}

.mm-manual-note .dashicons {
    flex-shrink: 0;
    color: var(--mm-accent);
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.mm-manual-note p {
    margin: 0;
    color: var(--mm-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.mm-order-details {
    margin: 22px 0;
    padding: 16px 18px;
    border: 1px solid var(--mm-border);
    border-radius: var(--mm-radius-md);
    background: rgba(248, 250, 252, 0.9);
}

.mm-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--mm-text-muted);
    font-size: 13px;
}

.mm-detail-row + .mm-detail-row {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--mm-border);
}

.mm-detail-row strong {
    color: var(--mm-text);
    font-size: 14px;
    font-weight: 650;
}

.mm-upsell-box {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid rgba(15, 118, 110, 0.15);
    border-radius: var(--mm-radius-md);
    background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
    text-align: left;
}

.mm-upsell-content {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.mm-upsell-content .dashicons {
    color: var(--mm-accent);
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.mm-upsell-content h4 {
    margin: 0 0 6px;
    color: var(--mm-text);
    font-size: 15px;
    font-weight: 650;
}

.mm-upsell-content p {
    margin: 0;
    color: var(--mm-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.mm-upgrade-btn,
.mm-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    transition: 180ms ease;
}

.mm-upgrade-btn {
    width: 100%;
    margin-top: 14px;
    background: transparent;
    border: 1px solid var(--mm-border-strong);
    color: var(--mm-text) !important;
}

.mm-upgrade-btn:hover {
    border-color: var(--mm-text);
    background: rgba(255, 255, 255, 0.75);
}

.mm-footer-actions p {
    margin: 0 0 14px;
    color: var(--mm-text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.mm-primary-btn {
    background: var(--mm-text);
    color: #ffffff !important;
}

.mm-primary-btn:hover {
    background: #020617;
}

.mm-secondary-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--mm-accent-strong);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.mm-secondary-link:hover {
    text-decoration: underline;
}

@media screen and (max-width: 782px) {
    .woocommerce-checkout .finachub-mm-checkout-wrapper.compact,
    .mm-waiting-container {
        padding: 22px 18px;
    }

    .mm-checkout-title {
        font-size: 23px;
    }

    .mm-checkout-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .mm-upsell-content {
        flex-direction: row;
    }
}
