/* TwintWP - Premium Stripe & TWINT Donation Form Styles */

:root {
    --twintwp-primary: #0284c7;
    --twintwp-primary-hover: #0369a1;
    --twintwp-primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    --twintwp-accent-glow: rgba(14, 165, 233, 0.25);
    --twintwp-bg-card: #ffffff;
    --twintwp-bg-subtle: #f8fafc;
    --twintwp-text-main: #0f172a;
    --twintwp-text-muted: #64748b;
    --twintwp-border: #e2e8f0;
    --twintwp-border-focus: #38bdf8;
    --twintwp-radius: 16px;
    --twintwp-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(15, 23, 42, 0.04);
}

.twintwp-donation-wrapper {
    max-width: 620px;
    margin: 0 auto;
    background: var(--twintwp-bg-card);
    border: 1px solid var(--twintwp-border);
    border-radius: var(--twintwp-radius);
    box-shadow: var(--twintwp-shadow);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--twintwp-text-main);
    overflow: hidden;
    padding: 32px 28px;
    box-sizing: border-box;
}

/* Stepper Header */
.twintwp-steps-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;
}

.twintwp-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.45;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.twintwp-step-item.active {
    opacity: 1;
}

.twintwp-step-badge {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.twintwp-badge-check {
    display: none;
    font-size: 14px;
}

.twintwp-step-item.completed .twintwp-badge-num {
    display: none;
}

.twintwp-step-item.completed .twintwp-badge-check {
    display: inline;
}

.twintwp-step-item.active .twintwp-step-badge,
.twintwp-step-item.completed .twintwp-step-badge {
    background: var(--twintwp-primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--twintwp-accent-glow);
}

.twintwp-step-title-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--twintwp-text-main);
}

.twintwp-step-connector {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    margin: 0 12px;
    border-radius: 2px;
    overflow: hidden;
}

.twintwp-connector-progress {
    height: 100%;
    background: var(--twintwp-primary-gradient);
    transition: width 0.4s ease;
}

/* Step Panels & Animations */
.twintwp-step-panel {
    display: none;
}

.twintwp-step-panel.active {
    display: block;
    animation: twintwpSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes twintwpSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.twintwp-panel-header {
    margin-bottom: 24px;
}

.twintwp-panel-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px 0;
    color: var(--twintwp-text-main);
    letter-spacing: -0.02em;
}

.twintwp-panel-header p {
    font-size: 14px;
    color: var(--twintwp-text-muted);
    margin: 0;
}

/* Frequency Pills */
.twintwp-freq-pills {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 5px;
    gap: 6px;
    margin-bottom: 24px;
}

.twintwp-freq-pill {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twintwp-freq-pill.active {
    background: #ffffff;
    color: var(--twintwp-text-main);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Amount Grid */
.twintwp-amount-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

@media (min-width: 480px) {
    .twintwp-amount-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.twintwp-amount-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.twintwp-amount-btn:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(14, 165, 233, 0.12);
}

.twintwp-amount-btn.selected {
    border-color: transparent;
    background: var(--twintwp-primary-gradient);
    color: #ffffff;
    box-shadow: 0 8px 20px var(--twintwp-accent-glow);
    transform: scale(1.02);
}

.amt-currency {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.8;
    text-transform: uppercase;
}

.amt-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.twintwp-custom-input-box {
    grid-column: span 2;
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 16px;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

@media (min-width: 480px) {
    .twintwp-custom-input-box {
        grid-column: span 2;
    }
}

.twintwp-custom-input-box:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.twintwp-input-prefix {
    font-weight: 800;
    font-size: 15px;
    color: #64748b;
    margin-right: 8px;
}

.twintwp-custom-input-box input {
    width: 100%;
    border: none !important;
    outline: none !important;
    padding: 14px 0 !important;
    font-size: 16px;
    font-weight: 700;
    box-shadow: none !important;
    background: transparent;
    color: var(--twintwp-text-main);
}

/* Input Fields & Layout */
.twintwp-form-grid {
    display: flex;
    gap: 14px;
}

.twintwp-input-group {
    flex: 1;
    margin-bottom: 18px;
}

.twintwp-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.twintwp-input-group label .star {
    color: #ef4444;
}

.twintwp-input-group input[type="text"],
.twintwp-input-group input[type="email"],
.twintwp-input-group textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--twintwp-text-main);
    background: #ffffff;
    transition: all 0.2s ease;
}

.twintwp-input-group input:focus,
.twintwp-input-group textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.twintwp-toggle-row {
    margin-bottom: 24px;
}

.twintwp-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
}

.twintwp-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--twintwp-primary);
    cursor: pointer;
}

/* Summary Card */
.twintwp-summary-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.twintwp-summary-label {
    font-size: 13px;
    font-weight: 700;
    color: #0369a1;
    text-transform: uppercase;
}

.twintwp-summary-amount {
    font-size: 24px;
    font-weight: 800;
    color: #0284c7;
}

.twintwp-summary-freq {
    font-size: 13px;
    font-weight: 700;
    background: #ffffff;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Payment Method Cards */
.twintwp-pay-methods-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.twintwp-method-card input[type="radio"] {
    display: none;
}

.twintwp-method-inner {
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 14px;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.25s ease;
}

.twintwp-method-card:hover .twintwp-method-inner {
    border-color: #38bdf8;
    transform: translateY(-2px);
}

.twintwp-method-card input[type="radio"]:checked + .twintwp-method-inner {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.12);
}

.twintwp-method-icon {
    margin-bottom: 8px;
    color: #0284c7;
}

.twint-brand-icon span {
    font-weight: 900;
    font-size: 18px;
    background: #000000;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: -0.03em;
}

.twintwp-method-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--twintwp-text-main);
    margin-bottom: 4px;
}

.twintwp-method-badges span {
    font-size: 10px;
    font-weight: 700;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

.twintwp-method-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
}

/* Payment Body Containers */
.twintwp-payment-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 24px;
}

/* Stripe Trust Header & PCI Security Disclaimer */
.twintwp-stripe-trust-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.twintwp-trust-left {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #059669;
    background: #ecfdf5;
    padding: 4px 10px;
    border-radius: 6px;
}

.twintwp-lock-icon {
    color: #059669;
}

.twintwp-stripe-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

.stripe-logo-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: #635bff;
    letter-spacing: -0.04em;
    text-transform: lowercase;
}

.twintwp-pci-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    color: #475569;
    line-height: 1.45;
}

.twintwp-pci-disclaimer svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #0284c7;
}

/* 3-field Stripe Box */
.twintwp-stripe-input-box {
    background: #ffffff;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.twintwp-stripe-input-box:focus-within {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* TWINT Beneficiary & Layout */
.twintwp-twint-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.twintwp-beneficiary-card {
    background: #ffffff;
    border-left: 4px solid #000000;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.twintwp-ben-header {
    margin-bottom: 4px;
}

.twintwp-ben-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: #059669;
    background: #ecfdf5;
    padding: 2px 8px;
    border-radius: 4px;
}

.twintwp-ben-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--twintwp-text-main);
}

.twintwp-ben-ref {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.twintwp-twint-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.twintwp-qr-container {
    background: #ffffff;
    padding: 16px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    text-align: center;
}

.twintwp-qr-image {
    max-width: 190px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.twintwp-qr-caption {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    margin-top: 8px;
}

.twintwp-twint-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #000000;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 15px;
    padding: 14px 28px;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.twintwp-twint-launch-btn:hover {
    background: #222222;
    transform: translateY(-2px);
}

/* Reference Code Box */
.twintwp-reference-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
}

.twintwp-reference-box label {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    display: block;
    margin-bottom: 8px;
}

.twintwp-ref-flex {
    display: flex;
    align-items: center;
    gap: 10px;
}

.twintwp-ref-flex code {
    flex: 1;
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 15px;
    font-weight: 700;
    color: #0284c7;
    letter-spacing: 0.05em;
}

.twintwp-copy-btn {
    background: var(--twintwp-primary-gradient);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.twintwp-copy-btn:hover {
    opacity: 0.9;
}

.twintwp-twint-tip {
    font-size: 12px;
    color: #64748b;
    margin: 8px 0 0 0;
    line-height: 1.4;
}

/* Action Buttons Bar */
.twintwp-actions-bar {
    display: flex;
    flex-direction: column-reverse;
    gap: 16px;
    margin-top: 24px;
}

@media (min-width: 480px) {
    .twintwp-actions-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0;
    }
}

.twintwp-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
    background: var(--twintwp-primary-gradient);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 20px var(--twintwp-accent-glow);
}

@media (min-width: 480px) {
    .twintwp-primary-btn {
        width: auto;
        margin-left: auto;
    }
}

.twintwp-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px var(--twintwp-accent-glow);
}

.twintwp-secondary-btn {
    background: transparent;
    color: #64748b;
    border: none;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
}

@media (min-width: 480px) {
    .twintwp-secondary-btn {
        background: #e2e8f0;
        color: #475569;
        width: auto;
        padding: 14px 24px;
    }
}

.twintwp-secondary-btn:hover {
    background: #cbd5e1;
}

.twintwp-error-banner {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}

/* Success Screen */
.twintwp-success-wrapper {
    text-align: center;
    padding: 40px 10px;
}

.twintwp-success-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.3);
    animation: twintwpPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes twintwpPopIn {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.twintwp-success-wrapper h3 {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 10px 0;
    color: var(--twintwp-text-main);
}

.twintwp-success-wrapper p {
    font-size: 15px;
    color: var(--twintwp-text-muted);
    max-width: 440px;
    margin: 0 auto 24px auto;
    line-height: 1.5;
}

.twintwp-btn-reset {
    margin-left: 0;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .twintwp-donation-wrapper {
        padding: 20px 16px;
    }

    .twintwp-step-title-text {
        display: none; /* Hide step labels on small screens to fit the circles */
    }

    .twintwp-step-connector {
        margin: 0 4px;
    }

    .twintwp-amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .twintwp-method-grid {
        grid-template-columns: 1fr;
    }

    .twintwp-form-row {
        flex-direction: column;
        gap: 16px;
    }

    .twintwp-btn-group {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .twintwp-btn-back {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .twintwp-btn-next, .twintwp-btn-submit {
        width: 100%;
        margin-left: 0;
    }
}

/* ==========================================================================
   Single Step Layout Mode Overrides
   ========================================================================== */
.twintwp-layout-single .twintwp-steps-header {
    display: none !important;
}

.twintwp-layout-single .twintwp-step-panel[data-step="1"],
.twintwp-layout-single .twintwp-step-panel[data-step="2"],
.twintwp-layout-single .twintwp-step-panel[data-step="3"] {
    display: block !important;
    opacity: 1 !important;
    animation: none !important;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 40px;
    margin-bottom: 40px;
}

.twintwp-layout-single .twintwp-step-panel[data-step="3"] {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.twintwp-layout-single .twintwp-step-panel[data-step="1"] .twintwp-actions-bar,
.twintwp-layout-single .twintwp-step-panel[data-step="2"] .twintwp-actions-bar,
.twintwp-layout-single .twintwp-step-panel[data-step="3"] .twintwp-btn-back {
    display: none !important;
}

/* Hide Steps 1, 2, 3 if Step 4 (Success) is active */
.twintwp-layout-single.success-active .twintwp-step-panel[data-step="1"],
.twintwp-layout-single.success-active .twintwp-step-panel[data-step="2"],
.twintwp-layout-single.success-active .twintwp-step-panel[data-step="3"] {
    display: none !important;
}
