/* =========================================================
   Pencil x Square Checkout — psc.css
   ========================================================= */

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

/* ================================================================
   MODAL OVERLAY
   ================================================================ */

.psc-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.psc-modal[hidden] { display: none !important; }

.psc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.psc-modal-box {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.18);
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 28px 24px;
    animation: psc-in 0.22s ease;
}

@keyframes psc-in {
    from { opacity:0; transform: translateY(16px) scale(0.97); }
    to   { opacity:1; transform: translateY(0)    scale(1);    }
}

/* ---- Header ---- */
.psc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.psc-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.psc-close {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 22px;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px !important;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.psc-close:hover {
    color: #111827;
    background: #f3f4f6 !important;
}

/* ---- Order summary ---- */
.psc-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #374151;
}

.psc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 3px 0;
    gap: 12px;
}

.psc-summary-variant-val {
    text-align: right;
    color: #6b7280;
    font-size: 13px;
}

.psc-summary-total-row {
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
    padding-top: 10px;
    font-size: 15px;
}

/* ---- Square card mount ---- */
#psc-card-container {
    min-height: 90px;
    margin-bottom: 16px;
}

#psc-card-container iframe {
    width: 100% !important;
}

/* ---- Email ---- */
.psc-field-wrap {
    margin-bottom: 16px;
}

.psc-field-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.psc-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 12px;
}

.psc-field-wrap input[type="email"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}

.psc-field-wrap input[type="email"]:focus {
    border-color: #006aff;
    box-shadow: 0 0 0 3px rgba(0,106,255,0.12);
}

/* ---- Status ---- */
.psc-status {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 14px;
}

.psc-status-info    { background:#eff6ff; color:#1d4ed8; border-left:3px solid #3b82f6; }
.psc-status-error   { background:#fef2f2; color:#b91c1c; border-left:3px solid #ef4444; }
.psc-status-success { background:#f0fdf4; color:#15803d; border-left:3px solid #22c55e; }

/* ---- Actions ---- */
.psc-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.psc-pay-btn {
    flex: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: #006aff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.psc-pay-btn:hover:not(:disabled) { background: #0050cc; }

.psc-pay-btn:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.psc-cancel-btn {
    padding: 13px 18px;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.psc-cancel-btn:hover { background: #e5e7eb; }

/* ---- Spinner ---- */
.psc-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: psc-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.psc-spinner[hidden] { display: none; }

@keyframes psc-spin { to { transform: rotate(360deg); } }

/* ---- Footer ---- */
.psc-powered-by {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin: 14px 0 0;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media ( max-width: 480px ) {
    .psc-modal-box {
        padding: 20px 16px 18px;
        border-radius: 8px;
    }
    .psc-actions { flex-direction: column; }
}
