/* 
 * Premium Glassmorphism Theme for Service Order Confirmation & PhonePe Gateway
 * Font: Outfit & Inter
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #090a0f;
    --card-bg: rgba(17, 19, 31, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(147, 51, 234, 0.4);
    
    --primary: #9333ea; /* Purple */
    --primary-glow: rgba(147, 51, 234, 0.4);
    --primary-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --phonepe-color: #5f259f; /* PhonePe Indigo */
    
    --success: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #ef4444; /* Rose */
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --font-outfit: 'Outfit', 'Inter', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-inter);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
    padding: 2rem 1rem;
}

/* Floating background glow blobs */
.bg-glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.35;
    animation: floatBlob 20s infinite alternate ease-in-out;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #6366f1;
    top: -10%;
    right: -10%;
    animation-duration: 25s;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background: #a855f7;
    bottom: -15%;
    left: -10%;
    animation-duration: 18s;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    top: 40%;
    left: 45%;
    opacity: 0.15;
    animation-duration: 22s;
    animation-delay: -10s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(60px, -40px) scale(1.1) rotate(180deg); }
    100% { transform: translate(-30px, 50px) scale(0.9) rotate(360deg); }
}

/* Main Layout Wrapper */
.payment-wrapper {
    width: 100%;
    max-width: 480px;
    perspective: 1000px;
    animation: cardEnter 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardEnter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-card:hover {
    border-color: rgba(147, 51, 234, 0.2);
    box-shadow: 0 25px 50px -12px rgba(147, 51, 234, 0.08);
}

/* Header Banner */
.card-header-banner {
    background: linear-gradient(90deg, rgba(95, 37, 159, 0.85) 0%, rgba(147, 51, 234, 0.85) 100%);
    padding: 1.75rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.card-header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transform: skewX(-25deg);
    animation: shine 4s infinite linear;
}

@keyframes shine {
    0% { left: -100%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

.card-header-banner h1 {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-header-banner p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

/* Contact Us Pill Section */
.contact-section {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.contact-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.contact-item:hover {
    background: rgba(147, 51, 234, 0.08);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.contact-item i {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.contact-item-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.contact-item-value {
    font-size: 0.72rem;
    font-weight: 500;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    max-width: 100%;
}

/* Form Container */
.checkout-form {
    padding: 1.75rem;
}

/* Amount Input Wrapper */
.amount-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.amount-container:focus-within {
    border-color: var(--border-hover);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

.amount-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

.amount-input-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.amount-symbol {
    font-family: var(--font-outfit);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.amount-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-outfit);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    width: 180px;
    text-align: left;
}

/* Chrome, Safari, Edge, Opera: Remove spin arrows */
.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* Firefox: Remove spin arrows */
.amount-input[type=number] {
    -moz-appearance: textfield;
}

/* Form Inputs styling */
.form-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1rem 1rem 2.75rem;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-inter);
    font-size: 0.92rem;
    font-weight: 400;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.15);
}

.form-group i.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
    pointer-events: none;
}

.form-input:focus + i.input-icon {
    color: var(--primary);
}

/* Floating labels and helpers */
.form-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.4rem;
    display: block;
    padding-left: 0.25rem;
}

.form-label span.req {
    color: var(--danger);
    margin-left: 2px;
}

.input-helper {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
    padding-left: 0.25rem;
}

/* Dynamic Checkout Breakdown Section */
.breakdown-box {
    background: rgba(255, 255, 255, 0.015);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    display: none; /* Enabled via JS when values exist */
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.4s ease forwards;
}

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

.breakdown-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.breakdown-row.total {
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* PhonePe Co-branding and Pay Button */
.pay-btn-container {
    margin-top: 1.5rem;
}

.pay-btn {
    width: 100%;
    background: var(--primary-gradient);
    border: none;
    outline: none;
    border-radius: 14px;
    padding: 1.1rem;
    color: #fff;
    font-family: var(--font-outfit);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 10px 20px -5px var(--primary-glow);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px var(--primary-glow);
    filter: brightness(1.05);
}

.pay-btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px -5px var(--primary-glow);
}

.pay-btn i.btn-arrow {
    transition: transform 0.3s ease;
}

.pay-btn:hover i.btn-arrow {
    transform: translateX(4px);
}

/* PhonePe badge alignment */
.phonepe-brand-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.25rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.phonepe-brand-badge svg {
    height: 15px;
    width: auto;
    fill: #5f259f;
}

/* Loading Overlay inside Card */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(147, 51, 234, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

.loader-overlay p {
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.loader-overlay span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ----------------------------------------------------
 * SUCCESS / FAILURE RESULT CARD LAYOUTS
 * ----------------------------------------------------
 */
.result-card {
    text-align: center;
    padding: 3rem 2rem 2.5rem;
}

.result-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
}

.result-icon-container.success {
    background: var(--success-glow);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    box-shadow: 0 0 20px -2px rgba(16, 185, 129, 0.2);
}

.result-icon-container.failed {
    background: var(--danger-glow);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    box-shadow: 0 0 20px -2px rgba(239, 68, 68, 0.2);
}

.result-icon-container i {
    font-size: 2.25rem;
    animation: popIcon 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes popIcon {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.result-title {
    font-family: var(--font-outfit);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-title.success { color: var(--success); }
.result-title.failed { color: var(--danger); }

.result-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Receipt Details Box */
.receipt-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
}

.receipt-header {
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.receipt-row:last-child {
    margin-bottom: 0;
}

.receipt-row span.val {
    color: var(--text-primary);
    font-weight: 500;
}

.receipt-row span.val.amount-val {
    font-family: var(--font-outfit);
    font-weight: 700;
    color: var(--primary);
}

/* CTA buttons for results */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.action-btn.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 5px 15px -3px var(--primary-glow);
}

.action-btn.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -3px var(--primary-glow);
}

.action-btn.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.action-btn.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

/* Responsive details */
@media (max-width: 480px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .glass-card {
        border-radius: 20px;
    }
    
    .checkout-form {
        padding: 1.25rem;
    }
    
    .contact-grid {
        gap: 0.35rem;
    }
    
    .contact-item-value {
        font-size: 0.65rem;
    }
}
