/**
 * DROPSOFT PESA - Frontend Styles
 * Modern, responsive, mobile-first design - Enhanced Attractive Version
 * 
 * @package DROPSOFT_PESA
 * @since 1.0.0
 */

/* ==========================================================================
   Base Styles & Container
   ========================================================================== */

.dpsp-payment-form-container {
    width: 100%;
    max-width: 520px;
    margin: 3rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    position: relative;
}

/* Background Decoration */
.dpsp-background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.dpsp-bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    filter: blur(60px);
    animation: dpsp-float 20s ease-in-out infinite;
}

.dpsp-bg-circle-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.dpsp-bg-circle-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    bottom: -50px;
    right: -50px;
    animation-delay: 7s;
}

.dpsp-bg-circle-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #3b82f6 0%, #93c5fd 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes dpsp-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.dpsp-payment-form-wrapper {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.12),
        0 8px 25px rgba(59, 130, 246, 0.2),
        0 0 0 1px rgba(59, 130, 246, 0.15);
    padding: 3rem 2.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.dpsp-payment-form-wrapper:hover {
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.15),
        0 10px 30px rgba(59, 130, 246, 0.25),
        0 0 0 1px rgba(59, 130, 246, 0.2);
    transform: translateY(-4px);
}

/* ==========================================================================
   Form Header with Icon
   ========================================================================== */

.dpsp-payment-form-header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: dpsp-slideDown 0.6s ease-out;
    position: relative;
}

@keyframes dpsp-slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dpsp-icon-wrapper {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    animation: dpsp-bounce 2s ease-in-out infinite;
}

@keyframes dpsp-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.dpsp-mpesa-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 8px 16px rgba(0, 168, 89, 0.3));
    transition: transform 0.3s ease;
}

.dpsp-mpesa-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.dpsp-form-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.dpsp-form-subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* ==========================================================================
   Configuration Notice Banner
   ========================================================================== */

.dpsp-config-notice {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    box-shadow: 
        0 4px 12px rgba(245, 158, 11, 0.2),
        0 2px 4px rgba(245, 158, 11, 0.1);
    animation: dpsp-slideDown 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.dpsp-config-notice::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    background-size: 200% 100%;
    animation: dpsp-shimmer 3s ease-in-out infinite;
}

@keyframes dpsp-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.dpsp-notice-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
    animation: dpsp-rotate 3s ease-in-out infinite;
}

@keyframes dpsp-rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.dpsp-notice-content {
    flex: 1;
}

.dpsp-notice-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.dpsp-notice-message {
    font-size: 0.95rem;
    color: #78350f;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.dpsp-notice-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    cursor: pointer;
}

.dpsp-notice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff;
    text-decoration: none;
}

.dpsp-notice-button:active {
    transform: translateY(0);
}

.dpsp-notice-help {
    font-size: 0.875rem;
    color: #92400e;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
    font-style: italic;
}

/* ==========================================================================
   Disabled Form State
   ========================================================================== */

.dpsp-form-disabled {
    opacity: 0.7;
    position: relative;
}

.dpsp-form-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    border-radius: 14px;
    z-index: 1;
}

.dpsp-form-disabled .dpsp-form-input {
    cursor: not-allowed;
    opacity: 0.6;
}

.dpsp-form-disabled .dpsp-form-input:focus {
    border-color: #e5e7eb;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   Form Elements with Icons
   ========================================================================== */

.dpsp-payment-form {
    width: 100%;
}

.dpsp-form-group {
    margin-bottom: 1.75rem;
    animation: dpsp-fadeInUp 0.6s ease-out backwards;
}

.dpsp-form-group:nth-child(1) { animation-delay: 0.1s; }
.dpsp-form-group:nth-child(2) { animation-delay: 0.2s; }
.dpsp-form-group:nth-child(3) { animation-delay: 0.3s; }
.dpsp-form-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes dpsp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dpsp-form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.dpsp-label-icon {
    font-size: 1.2rem;
    filter: grayscale(0.3);
}

.dpsp-required {
    color: #ef4444;
    margin-left: 2px;
    font-weight: 700;
}

.dpsp-optional {
    color: #9ca3af;
    font-weight: 400;
    font-size: 0.85rem;
    margin-left: auto;
}

.dpsp-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.dpsp-currency-symbol {
    display: none !important;
}

.dpsp-form-input {
    width: 100%;
    padding: 1rem 1rem 1rem 4rem;
    font-size: 1rem;
    font-family: inherit;
    color: #1f2937;
    background: linear-gradient(145deg, #ffffff 0%, #f9fafb 100%);
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.02),
        0 1px 2px rgba(0, 0, 0, 0.05);
}

.dpsp-amount-input {
    padding-left: 1rem;
}

.dpsp-form-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.2),
        0 4px 12px rgba(37, 99, 235, 0.25),
        inset 0 1px 2px rgba(0, 0, 0, 0.02);
    transform: translateY(-2px);
}

.dpsp-form-input::placeholder {
    color: #9ca3af;
    opacity: 0.7;
}

.dpsp-form-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
    background: #fef2f2;
}

.dpsp-form-input:valid:not(:placeholder-shown) {
    border-color: #2563eb;
}

.dpsp-form-input.dpsp-input-error {
    border-color: #ef4444;
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%);
    animation: dpsp-shake 0.5s ease-in-out;
}

@keyframes dpsp-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.dpsp-input-icon {
    position: absolute;
    right: 1rem;
    font-size: 1.2rem;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.dpsp-form-input:focus + .dpsp-input-icon {
    opacity: 0.6;
}

.dpsp-field-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
    padding-left: 0.5rem;
}

.dpsp-error-message {
    display: block;
    font-size: 0.85rem;
    color: #ef4444;
    margin-top: 0.5rem;
    min-height: 1.2rem;
    padding-left: 0.5rem;
    font-weight: 500;
    animation: dpsp-fadeIn 0.3s ease;
}

/* ==========================================================================
   Submit Button - Enhanced
   ========================================================================== */

.dpsp-submit-group {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

.dpsp-submit-button {
    width: 100%;
    padding: 1.25rem 2rem;
    font-size: 1.125rem;
    font-weight: 700;
    font-family: inherit;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 24px rgba(0, 168, 89, 0.35),
        0 4px 8px rgba(0, 168, 89, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.dpsp-submit-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.dpsp-submit-button:hover::before {
    left: 100%;
}

.dpsp-submit-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 32px rgba(37, 99, 235, 0.5),
        0 6px 12px rgba(59, 130, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background-position: right center;
}

.dpsp-submit-button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(37, 99, 235, 0.45),
        0 3px 6px rgba(59, 130, 246, 0.4);
}

.dpsp-submit-button:disabled,
.dpsp-submit-button.dpsp-button-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    box-shadow: 
        0 4px 12px rgba(156, 163, 175, 0.2),
        0 2px 4px rgba(156, 163, 175, 0.1);
}

.dpsp-submit-button.dpsp-button-disabled:hover {
    transform: none;
    box-shadow: 
        0 4px 12px rgba(156, 163, 175, 0.2),
        0 2px 4px rgba(156, 163, 175, 0.1);
}

.dpsp-button-hint {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    font-size: 0.875rem;
    color: #92400e;
    text-align: center;
    line-height: 1.5;
    animation: dpsp-fadeIn 0.4s ease;
}

.dpsp-button-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.dpsp-button-icon {
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-weight: bold;
}

.dpsp-button-text {
    display: inline-block;
}

.dpsp-button-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.dpsp-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: dpsp-spin 0.8s linear infinite;
}

@keyframes dpsp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Security Badge
   ========================================================================== */

.dpsp-security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-top: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid rgba(0, 168, 89, 0.2);
    border-radius: 12px;
    font-size: 0.875rem;
    color: #166534;
    font-weight: 500;
}

.dpsp-lock-icon {
    font-size: 1.1rem;
}

.dpsp-security-text {
    letter-spacing: 0.3px;
}

/* ==========================================================================
   Messages & Alerts
   ========================================================================== */

.dpsp-message {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    font-size: 1rem;
    line-height: 1.8;
    animation: dpsp-fadeIn 0.4s ease, dpsp-slideDown 0.4s ease;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
    min-height: 80px;
    display: flex;
    align-items: center;
}

.dpsp-message.dpsp-success {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 3px solid #2563eb;
    color: #1e40af;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3), 0 4px 8px rgba(59, 130, 246, 0.2);
}

.dpsp-message.dpsp-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 3px solid #ef4444;
    color: #991b1b;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.2), 0 4px 8px rgba(239, 68, 68, 0.1);
}

.dpsp-message.dpsp-info {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 3px solid #f59e0b;
    color: #92400e;
    position: relative;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2), 0 4px 8px rgba(245, 158, 11, 0.1);
}

.dpsp-message-icon {
    display: inline-block;
    margin-right: 0.75rem;
    font-size: 1.5rem;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.dpsp-message.dpsp-info .dpsp-message-icon {
    animation: dpsp-pulse 2s ease-in-out infinite;
}

.dpsp-message.dpsp-success .dpsp-message-icon {
    color: #2563eb;
    font-weight: bold;
}

.dpsp-message.dpsp-error .dpsp-message-icon {
    color: #ef4444;
    font-weight: bold;
}

.dpsp-message-text {
    display: inline-block;
    vertical-align: middle;
    line-height: 1.8;
    flex: 1;
    width: 100%;
}

/* Ensure message is always visible */
#dpsp-message {
    display: block !important;
    visibility: visible !important;
}

#dpsp-message[style*="display: none"] {
    display: block !important;
    opacity: 0;
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* ==========================================================================
   Modal Popup Overlays
   ========================================================================== */

.dpsp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: dpsp-modal-fadeIn 0.3s ease-out;
}

.dpsp-modal-content {
    background: white;
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    animation: dpsp-modal-slideUp 0.4s ease-out;
}

.dpsp-success-modal {
    border: 4px solid #10b981;
}

.dpsp-failure-modal {
    border: 4px solid #ef4444;
}

.dpsp-modal-icon-wrapper {
    margin-bottom: 1.5rem;
}

.dpsp-modal-success-icon,
.dpsp-modal-failure-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    margin: 0 auto;
    animation: dpsp-modal-icon-bounce 0.6s ease-out;
}

.dpsp-modal-success-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

.dpsp-modal-failure-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.dpsp-modal-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
}

.dpsp-success-modal .dpsp-modal-title {
    color: #059669;
}

.dpsp-failure-modal .dpsp-modal-title {
    color: #dc2626;
}

.dpsp-modal-details {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: #374151;
}

.dpsp-modal-details div {
    margin: 0.75rem 0;
}

.dpsp-modal-details strong {
    font-weight: 600;
    color: #1f2937;
}

.dpsp-modal-button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.5);
    min-width: 150px;
}

.dpsp-modal-button:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.dpsp-modal-button:active {
    transform: translateY(0);
}

.dpsp-failure-modal .dpsp-modal-button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.dpsp-failure-modal .dpsp-modal-button:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.dpsp-pulse-animation {
    animation: dpsp-pulse 2s ease-in-out infinite;
}

@keyframes dpsp-modal-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes dpsp-modal-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes dpsp-modal-icon-bounce {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(0.95);
    }
    75% {
        transform: scale(1.05);
    }
}

@keyframes dpsp-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(16, 185, 129, 0.6);
    }
}

/* Mobile responsive for modals */
@media (max-width: 600px) {
    .dpsp-modal-overlay {
        padding: 10px;
    }
    
    .dpsp-modal-content {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }
    
    .dpsp-modal-success-icon,
    .dpsp-modal-failure-icon {
        width: 80px;
        height: 80px;
        font-size: 3rem;
    }
    
    .dpsp-modal-title {
        font-size: 1.5rem;
    }
    
    .dpsp-modal-details {
        font-size: 1rem;
    }
    
    .dpsp-modal-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

.dpsp-message-text strong {
    font-weight: 700;
    color: inherit;
}

.dpsp-message.dpsp-success .dpsp-message-text strong {
    color: #2563eb;
    font-size: 1.1em;
}

.dpsp-message-content {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.dpsp-message-content .dpsp-message-text {
    flex: 1;
}

@keyframes dpsp-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.dpsp-error {
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid #ef4444;
    border-radius: 14px;
    color: #991b1b;
    margin: 1rem 0;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

@keyframes dpsp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dpsp-slideDown {
    from {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        margin-bottom: 0;
        overflow: hidden;
    }
    to {
        max-height: 500px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        overflow: visible;
    }
}

/* ==========================================================================
   Payment Status Icon
   ========================================================================== */

.dpsp-status-icon-container {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: dpsp-slideDown 0.5s ease-out;
    transition: all 0.4s ease;
}

.dpsp-status-icon-container.dpsp-status-success {
    background: linear-gradient(145deg, #ecfdf5 0%, #d1fae5 100%);
    border: 3px solid #10b981;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3), 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.dpsp-status-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: bold;
    position: relative;
    transition: all 0.4s ease;
}

.dpsp-status-icon-container.dpsp-status-processing .dpsp-status-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 4px solid #f59e0b;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
    animation: dpsp-icon-pulse 2s ease-in-out infinite;
}

.dpsp-status-icon-container.dpsp-status-success .dpsp-status-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 5px solid #10b981;
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6), 0 0 0 8px rgba(16, 185, 129, 0.1);
    animation: dpsp-icon-bounce 0.6s ease-out, dpsp-success-pulse 2s ease-in-out infinite;
}

.dpsp-status-icon-container.dpsp-status-failed .dpsp-status-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 4px solid #ef4444;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
    animation: dpsp-icon-shake 0.5s ease-out;
}

.dpsp-icon-spinner {
    animation: dpsp-spin 1.5s linear infinite;
    display: inline-block;
}

.dpsp-icon-success {
    color: #10b981;
    font-size: 5rem;
    font-weight: bold;
    animation: dpsp-checkmark-draw 0.8s ease-out;
}

.dpsp-icon-failed {
    color: #ef4444;
    font-size: 4rem;
}

.dpsp-status-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.dpsp-status-processing .dpsp-status-text {
    color: #92400e;
}

.dpsp-status-success .dpsp-status-text {
    color: #047857;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dpsp-status-failed .dpsp-status-text {
    color: #991b1b;
}

@keyframes dpsp-icon-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(245, 158, 11, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
    }
}

@keyframes dpsp-icon-bounce {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.3);
    }
    75% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes dpsp-success-pulse {
    0%, 100% {
        box-shadow: 0 12px 40px rgba(16, 185, 129, 0.6), 0 0 0 8px rgba(16, 185, 129, 0.1);
    }
    50% {
        box-shadow: 0 16px 50px rgba(16, 185, 129, 0.8), 0 0 0 12px rgba(16, 185, 129, 0.2);
    }
}

@keyframes dpsp-checkmark-draw {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

@keyframes dpsp-icon-shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes dpsp-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive Design - Mobile First
   ========================================================================== */

/* Small devices (phones, 320px and up) */
@media (max-width: 480px) {
    .dpsp-payment-form-container {
        margin: 1.5rem auto;
        padding: 0 0.75rem;
    }
    
    .dpsp-payment-form-wrapper {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .dpsp-config-notice {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .dpsp-notice-icon {
        font-size: 1.5rem;
        margin: 0 auto;
    }
    
    .dpsp-notice-title {
        font-size: 1rem;
    }
    
    .dpsp-notice-message {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
    }
    
    .dpsp-notice-button {
        width: 100%;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .dpsp-mpesa-icon {
        width: 60px;
        height: 60px;
    }
    
    .dpsp-form-title {
        font-size: 1.5rem;
    }
    
    .dpsp-form-subtitle {
        font-size: 0.9rem;
    }
    
    .dpsp-form-input {
        padding: 0.875rem 0.875rem 0.875rem 3.5rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .dpsp-amount-input {
        padding-left: 0.875rem;
    }
    
    .dpsp-currency-symbol {
        display: none !important;
    }
    
    .dpsp-submit-button {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 56px;
    }
    
    .dpsp-bg-circle {
        filter: blur(40px);
    }
    
    .dpsp-bg-circle-1 {
        width: 200px;
        height: 200px;
    }
    
    .dpsp-bg-circle-2 {
        width: 180px;
        height: 180px;
    }
    
    .dpsp-bg-circle-3 {
        width: 150px;
        height: 150px;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .dpsp-payment-form-container {
        max-width: 580px;
    }
    
    .dpsp-payment-form-wrapper {
        padding: 3.5rem 3rem;
    }
    
    .dpsp-form-title {
        font-size: 2.25rem;
    }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .dpsp-payment-form-container {
        max-width: 620px;
    }
    
    .dpsp-payment-form-wrapper {
        padding: 4rem 3.5rem;
    }
}

/* ==========================================================================
   Accessibility & Focus States
   ========================================================================== */

.dpsp-form-input:focus-visible {
    outline: 3px solid rgba(0, 168, 89, 0.5);
    outline-offset: 2px;
}

.dpsp-submit-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 3px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dpsp-payment-form-wrapper {
        border: 2px solid #000000;
    }
    
    .dpsp-form-input {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (if user prefers dark) */
@media (prefers-color-scheme: dark) {
    .dpsp-payment-form-wrapper {
        background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.5),
            0 8px 25px rgba(0, 168, 89, 0.15),
            0 0 0 1px rgba(0, 168, 89, 0.1);
    }
    
    .dpsp-form-title {
        background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #93c5fd 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .dpsp-form-subtitle {
        color: #d1d5db;
    }
    
    .dpsp-form-label {
        color: #e5e7eb;
    }
    
    .dpsp-form-input {
        background: linear-gradient(145deg, #374151 0%, #1f2937 100%);
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .dpsp-form-input:focus {
        background: #374151;
    }
    
    .dpsp-field-description {
        color: #9ca3af;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .dpsp-payment-form-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .dpsp-payment-form-wrapper {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .dpsp-submit-button,
    .dpsp-background-decoration {
        display: none;
    }
}

/* ==========================================================================
   PWA Install Button Styles
   ========================================================================== */

.dpsp-pwa-install-container {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.dpsp-pwa-install-btn,
.dpsp-pwa-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    text-decoration: none;
    font-family: inherit;
}

.dpsp-pwa-install-btn:hover,
.dpsp-pwa-open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
}

.dpsp-pwa-install-btn:active,
.dpsp-pwa-open-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.dpsp-pwa-install-btn svg,
.dpsp-pwa-open-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

.dpsp-pwa-install-btn span,
.dpsp-pwa-open-btn span {
    white-space: nowrap;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .dpsp-pwa-install-btn,
    .dpsp-pwa-open-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .dpsp-pwa-install-btn svg,
    .dpsp-pwa-open-btn svg {
        width: 18px;
        height: 18px;
    }
}
