/* ===== RESET & BASE ===== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent: #38bdf8;
    --accent-alt: #818cf8;
    --bg-gradient-1: #020617;
    --bg-gradient-2: #0c1a3d;
    --bg-gradient-3: #071028;
    --card-bg: rgba(255, 255, 255, 0.06);
    --card-border: rgba(59, 130, 246, 0.25);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.45);
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(59, 130, 246, 0.2);
    --input-focus: #60a5fa;
    --error: #f87171;
    --success: #34d399;
    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;
    --shadow: 0 25px 60px -12px rgba(37, 99, 235, 0.35);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    color: var(--text-primary);
    padding: 20px;
    overflow-x: hidden;
}


/* ===== BACKGROUND SHAPES ===== */

.background-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: #3b82f6;
    top: -120px;
    right: -120px;
    animation-delay: 0s;
    opacity: 0.45;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -80px;
    left: -80px;
    animation-delay: -7s;
    opacity: 0.4;
}

.shape-3 {
    width: 350px;
    height: 350px;
    background: #818cf8;
    top: 50%;
    left: 50%;
    animation-delay: -14s;
    opacity: 0.35;
}

@keyframes float {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -40px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }
    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}


/* ===== CONTAINER ===== */

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ===== PAYMENT CARD ===== */

.payment-card {
    background: var(--card-bg);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.payment-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #3b82f6, #38bdf8, #06b6d4);
    border-radius: var(--radius) var(--radius) 0 0;
}


/* ===== HEADER ===== */

.payment-header {
    text-align: center;
    margin-bottom: 28px;
}

.lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(56, 189, 248, 0.2));
    color: var(--accent);
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.payment-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #ffffff, #bfdbfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}


/* ===== AMOUNT DISPLAY ===== */

.amount-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-sm);
    margin-bottom: 28px;
}

.amount-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.amount-value {
    font-size: 30px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}


/* ===== FORM STYLES ===== */

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    font-weight: 400;
    transition: all 0.3s ease;
    outline: none;
    letter-spacing: 0.3px;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.input-wrapper input:focus {
    border-color: var(--input-focus);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}

.input-wrapper input:focus+.input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary-light);
}

.input-wrapper input.valid {
    border-color: var(--success);
}

.input-wrapper input.valid~.input-icon {
    color: var(--success);
}

.input-wrapper input.invalid {
    border-color: var(--error);
}

.input-wrapper input.invalid~.input-icon {
    color: var(--error);
}

.error-message {
    font-size: 12px;
    color: var(--error);
    min-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
}

.error-message.visible {
    min-height: 16px;
    opacity: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}


/* ===== PAY BUTTON ===== */

.pay-button {
    margin-top: 8px;
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #2563eb, #3b82f6, #06b6d4);
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pay-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pay-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(37, 99, 235, 0.45);
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.pay-button:hover::before {
    opacity: 1;
}

.pay-button:active {
    transform: translateY(0);
}

.pay-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-text,
.button-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ===== SECURITY BADGES ===== */

.security-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    flex-wrap: wrap;
}

.badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.badge svg {
    opacity: 0.6;
}


/* ===== SUCCESS OVERLAY ===== */

.success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    padding: 20px;
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-modal {
    background: linear-gradient(135deg, #020617, #0c1a3d);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.success-overlay.active .success-modal {
    transform: scale(1);
}

.success-checkmark {
    margin-bottom: 24px;
}

.circle-anim {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: drawCircle 0.6s ease-out 0.3s forwards;
}

.check-anim {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.4s ease-out 0.7s forwards;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.success-modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #34d399;
}

.success-modal p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.transaction-id {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    font-family: monospace;
    margin-bottom: 24px !important;
}

.done-button {
    padding: 14px 44px;
    background: linear-gradient(135deg, #34d399, #06b6d4);
    color: white;
    border: none;
    border-radius: var(--radius-xs);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
}

.done-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(52, 211, 153, 0.35);
}


/* ===== RESPONSIVE ===== */

@media (max-width: 520px) {
    .payment-card {
        padding: 28px 20px;
    }
    .payment-header h1 {
        font-size: 20px;
    }
    .amount-value {
        font-size: 24px;
    }
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .security-badges {
        gap: 12px;
    }
    .badge {
        font-size: 10px;
    }
    .success-modal {
        padding: 36px 24px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 12px;
    }
    .payment-card {
        padding: 24px 16px;
    }
    .input-wrapper input {
        padding: 12px 14px 12px 42px;
        font-size: 14px;
    }
    .security-badges {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
}


/* ===== ANIMATIONS UTILITAIRES ===== */

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    }
}


/* ===== STATUS PAGES (Expiré / Introuvable / Payé) ===== */

.status-card {
    text-align: center;
    padding: 48px 32px;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-bottom: 24px;
    animation: statusPulse 2s ease-in-out infinite;
}

.expired-icon {
    background: rgba(251, 146, 60, 0.1);
    color: #fb923c;
    border: 2px solid rgba(251, 146, 60, 0.2);
}

.notfound-icon {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 2px solid rgba(248, 113, 113, 0.2);
}

.paid-icon {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 2px solid rgba(52, 211, 153, 0.2);
}

@keyframes statusPulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.status-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fb923c, #f97316);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-card:has(.notfound-icon) .status-title {
    background: linear-gradient(135deg, #f87171, #ef4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.paid-title {
    background: linear-gradient(135deg, #34d399, #10b981) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.status-message {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.status-detail {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 360px;
    margin: 0 auto 24px;
}

.status-info {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    max-width: 340px;
    margin: 0 auto;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.info-row+.info-row {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.info-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 520px) {
    .status-card {
        padding: 36px 20px;
    }
    .status-icon {
        width: 80px;
        height: 80px;
    }
    .status-icon svg {
        width: 48px;
        height: 48px;
    }
    .status-title {
        font-size: 22px;
    }
}