/**
 * Clarity Space Payment Styles
 * Stripe Elements integration styling
 */

/* Payment Form Container */
.payment-form {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.payment-header {
    margin-bottom: 24px;
}

.payment-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.payment-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.payment-description strong {
    color: #4f46e5;
}

/* Form Fields */
.payment-field {
    margin-bottom: 20px;
}

.payment-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Stripe Card Element Container */
.payment-card-element {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.payment-card-element:hover {
    border-color: #9ca3af;
}

.payment-card-element:focus-within {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Error Display */
.payment-errors {
    margin-top: 8px;
    padding: 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.875rem;
}

/* Security Note */
.payment-security-note {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.75rem;
    margin-bottom: 20px;
}

.payment-security-note svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* Submit Button */
.payment-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
}

.payment-btn-submit {
    width: 100%;
    background: #4f46e5;
    color: #ffffff;
}

.payment-btn-submit:hover:not(:disabled) {
    background: #4338ca;
}

.payment-btn-submit:disabled {
    background: #a5b4fc;
    cursor: not-allowed;
}

.payment-btn-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Cancel Hold Button */
.payment-btn-cancel-hold {
    width: 100%;
    margin-top: 16px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.payment-btn-cancel-hold:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Existing Hold Display */
.payment-existing-hold {
    text-align: center;
    padding: 24px;
}

.payment-hold-status {
    padding: 32px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 12px;
}

.payment-hold-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: #dcfce7;
    border-radius: 50%;
    color: #16a34a;
    margin-bottom: 16px;
}

.payment-hold-status h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #166534;
    margin: 0 0 8px 0;
}

.payment-hold-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #15803d;
    margin: 0 0 4px 0;
}

.payment-hold-expires {
    font-size: 0.875rem;
    color: #166534;
    margin: 0 0 16px 0;
}

.payment-hold-note {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Success State */
.payment-success {
    text-align: center;
    padding: 48px 24px;
}

.payment-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background: #dcfce7;
    border-radius: 50%;
    color: #16a34a;
    margin-bottom: 24px;
}

.payment-success h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.payment-success p {
    color: #6b7280;
    margin: 0 0 8px 0;
}

.payment-success-note {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Payment Modal Overlay */
.payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.payment-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.payment-modal-overlay.visible .payment-modal {
    transform: scale(1);
}

.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.payment-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.payment-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s ease;
}

.payment-modal-close:hover {
    background: #f3f4f6;
}

.payment-modal-body {
    padding: 24px;
}

/* Responsive */
@media (max-width: 640px) {
    .payment-form {
        padding: 16px;
    }

    .payment-modal {
        width: 95%;
        margin: 16px;
    }

    .payment-btn {
        padding: 14px 20px;
        min-height: 48px; /* Touch-friendly */
    }
}
