/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
}

/* ===== BACKGROUND ANIMATION ===== */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(30, 58, 138, 0.05) 0%, transparent 50%);
    z-index: -1;
}

/* ===== SUCCESS CONTAINER ===== */
.success-container {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
    padding: 4rem 3rem;
    border-radius: 24px;
    box-shadow: 
        0 10px 40px rgba(30, 58, 138, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.8);
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: containerAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, 
        #10b981, 
        #34d399, 
        #10b981
    );
    animation: gradientFlow 3s linear infinite;
}

.success-container::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(16, 185, 129, 0.1) 0%, 
        transparent 70%
    );
    animation: pulse 4s ease-in-out infinite;
    z-index: -1;
}

/* ===== CHECK ICON ===== */
.icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    font-size: 3.5rem;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 2rem;
    box-shadow: 
        0 10px 30px rgba(16, 185, 129, 0.3),
        0 0 0 10px rgba(16, 185, 129, 0.1),
        0 0 0 20px rgba(16, 185, 129, 0.05);
    animation: 
        checkAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both,
        checkFloat 3s ease-in-out infinite 1s;
    position: relative;
}

.icon-check::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid #10b981;
    border-radius: 50%;
    animation: ripple 2s ease-out infinite;
}

/* ===== HEADING ===== */
.success-container h2 {
    color: #1e3a8a;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    position: relative;
    display: inline-block;
    animation: textAppear 0.6s ease 0.5s both;
}

.success-container h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
    animation: lineExpand 0.8s ease 0.8s both;
}

/* ===== MESSAGE TEXT ===== */
.message-text {
    color: #4b5563;
    font-size: 1.2rem;
    line-height: 1.7;
    margin-bottom: 3rem;
    padding: 0 1rem;
    animation: textAppear 0.6s ease 0.7s both;
}

.message-text br {
    display: none;
}

.message-text strong {
    color: #10b981;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.message-text strong::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 1px;
    animation: underlinePulse 2s ease-in-out infinite;
}

/* ===== BACK BUTTON ===== */
.success-container a {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(90deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    text-decoration: none;
    padding: 1.25rem 2.5rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 25px rgba(30, 58, 138, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    animation: buttonAppear 0.6s ease 0.9s both;
    z-index: 1;
}

.success-container a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    transition: left 0.7s ease;
    z-index: -1;
}

.success-container a:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(30, 58, 138, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.success-container a:hover::before {
    left: 100%;
}

.success-container a:active {
    transform: translateY(-1px);
}

.success-container a::after {
    content: '←';
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.success-container a:hover::after {
    transform: translateX(-5px);
}

/* ===== ANIMATIONS ===== */
@keyframes containerAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes checkAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

@keyframes checkFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes textAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lineExpand {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 80px;
        opacity: 1;
    }
}

@keyframes buttonAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes underlinePulse {
    0%, 100% {
        opacity: 0.7;
        width: 100%;
    }
    50% {
        opacity: 1;
        width: 105%;
    }
}

/* ===== CONFETTI EFFECT (Optional) ===== */
.confetti {
    position: fixed;
    width: 15px;
    height: 15px;
    background: linear-gradient(45deg, #10b981, #34d399, #3b82f6, #8b5cf6);
    opacity: 0;
    z-index: -1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    body {
        padding: 1.5rem;
    }
    
    .success-container {
        padding: 3rem 2rem;
        border-radius: 20px;
    }
    
    .icon-check {
        width: 80px;
        height: 80px;
        font-size: 2.8rem;
        margin-bottom: 1.5rem;
    }
    
    .success-container h2 {
        font-size: 2rem;
    }
    
    .message-text {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }
    
    .success-container a {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .success-container {
        padding: 2.5rem 1.5rem;
        border-radius: 16px;
    }
    
    .icon-check {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
        margin-bottom: 1.25rem;
    }
    
    .success-container h2 {
        font-size: 1.8rem;
    }
    
    .message-text {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0;
    }
    
    .message-text br {
        display: block;
    }
    
    .success-container a {
        padding: 0.875rem 1.75rem;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white !important;
    }
    
    .success-container {
        box-shadow: none !important;
        border: 2px solid #10b981 !important;
        background: white !important;
    }
    
    .icon-check {
        box-shadow: none !important;
        border: 3px solid #10b981 !important;
    }
    
    .success-container a {
        display: none !important;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .success-container {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
        border-color: rgba(255, 255, 255, 0.1);
        color: #e2e8f0;
    }
    
    .success-container h2 {
        color: #e2e8f0;
    }
    
    .message-text {
        color: #94a3b8;
    }
    
    .success-container a {
        background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .success-container::before,
    .success-container::after,
    .icon-check::after {
        display: none;
    }
    
    .icon-check {
        animation: none !important;
    }
}