@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
    --background-color: #0F0F0F;
    --primary-text-color: #F1F1F1;
    --secondary-text-color: #B0B0B0;
    --container-bg: rgba(26, 26, 26, 0.65);
    --card-bg: rgba(32, 32, 32, 0.75);
    --border-color: rgba(255, 255, 255, 0.12);
    --gradient-start: #A78BFA;
    --gradient-end: #EC4899;
    --success-color: #10B981;
    --error-color: #EF4444;
    --accent-color: #6366F1;
    --surface-color: rgba(255, 255, 255, 0.08);
    --surface-hover: rgba(255, 255, 255, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--primary-text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Animated background - front-end style */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 25%, hsla(250, 80%, 70%, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, hsla(320, 80%, 70%, 0.15) 0%, transparent 40%);
    z-index: -1;
    animation: backgroundShift 25s ease-in-out infinite alternate;
}

/* Success page - starts with minimal gradient */
body.success::before {
    background:
        radial-gradient(circle at 15% 25%, hsla(250, 80%, 70%, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, hsla(320, 80%, 70%, 0.03) 0%, transparent 40%);
    animation: backgroundShift 25s ease-in-out infinite alternate;
}

/* Error page - starts with minimal gradient */
body.error::before {
    background:
        radial-gradient(circle at 15% 25%, hsla(250, 80%, 70%, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 85% 75%, hsla(320, 80%, 70%, 0.03) 0%, transparent 40%);
    animation: backgroundShift 25s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { transform: scale(1) rotate(0deg) translate(0, 0); }
    100% { transform: scale(1.2) rotate(5deg) translate(10px, -10px); }
}


/* Main container */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 480px;
    padding: 45px 35px;
    background: var(--container-bg);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 1;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(167, 139, 250, 0.08) 0%,
        rgba(236, 72, 153, 0.08) 100%);
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.container:hover::before {
    opacity: 1;
}

/* Server invite container */
.server-invite-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 480px;
    padding: 45px 35px;
    background: var(--container-bg);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 1;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.server-invite-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(167, 139, 250, 0.1) 0%,
        rgba(236, 72, 153, 0.1) 100%);
    border-radius: 24px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.server-invite-container:hover::before {
    opacity: 1;
}

/* Icon styles */
.status-icon {
    width: 90px;
    height: 90px;
    margin-bottom: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.status-icon.success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    box-shadow:
        0 15px 40px rgba(16, 185, 129, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-color: rgba(16, 185, 129, 0.3);
}

.status-icon.error {
    background: linear-gradient(135deg, var(--error-color), #C0392B);
    box-shadow:
        0 15px 40px rgba(231, 76, 60, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    border-color: rgba(231, 76, 60, 0.3);
}

.status-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent);
    border-radius: 50%;
    animation: iconShimmer 3s infinite;
}

@keyframes iconShimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    50% { transform: translateX(100%) rotate(45deg); }
    100% { transform: translateX(-100%) rotate(45deg); }
}

.status-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

.status-icon.success:hover {
    box-shadow:
        0 20px 50px rgba(16, 185, 129, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.status-icon.error:hover {
    box-shadow:
        0 20px 50px rgba(231, 76, 60, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

/* Progress bar for success pages */
.progress-container {
    width: 100%;
    margin: 20px 0 30px 0;
    padding: 0 20px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.1) 100%);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--success-color),
        #059669,
        var(--success-color));
    background-size: 200% 100%;
    border-radius: 8px;
    width: 0;
    animation:
        fillProgress 2s ease-out forwards,
        progressGlow 2s infinite;
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.8),
        0 0 40px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent);
    animation: progressSlide 1.5s infinite;
}

@keyframes progressSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-fill.error {
    background: linear-gradient(90deg,
        var(--error-color),
        #C0392B,
        var(--error-color));
    background-size: 200% 100%;
    box-shadow:
        0 0 20px rgba(239, 68, 68, 0.8),
        0 0 40px rgba(239, 68, 68, 0.4);
    animation:
        fillProgress 2s ease-out forwards,
        progressGlow 2s infinite;
}

@keyframes fillProgress {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes progressGlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Server image */
.server-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin-bottom: 30px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.server-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
        rgba(167, 139, 250, 0.2) 0%,
        rgba(236, 72, 153, 0.2) 100%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.server-image:hover {
    transform: scale(1.08) rotate(2deg);
    border-color: rgba(167, 139, 250, 0.4);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(167, 139, 250, 0.3);
}

.server-image:hover::before {
    opacity: 1;
}

/* Text styles */
.status-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-title.success {
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.server-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(167, 139, 250, 0.3);
    letter-spacing: -0.5px;
    line-height: 1.2;
    position: relative;
}

.server-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border-radius: 2px;
    opacity: 0.6;
}

.status-message {
    font-size: 18px;
    color: var(--primary-text-color);
    margin-bottom: 15px;
    line-height: 1.6;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.3px;
}

.status-submessage {
    font-size: 15px;
    color: var(--secondary-text-color);
    opacity: 0.75;
    line-height: 1.5;
    font-weight: 400;
    letter-spacing: 0.2px;
    margin-top: 8px;
}

/* Member info */
.member-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--primary-text-color);
    font-size: 16px;
    font-weight: 500;
}

.member-info span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--surface-color);
    border-radius: 25px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.member-info span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.6s ease;
}

.member-info span:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.member-info span:hover::before {
    left: 100%;
}

.status-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.total-circle {
    background: linear-gradient(135deg, var(--secondary-text-color), #8A8A8A);
    box-shadow: 0 0 8px rgba(160, 160, 160, 0.3);
}

.online-circle {
    background: linear-gradient(135deg, var(--success-color), #059669);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    }
}


/* Form styles */
.verify-form, .invite-form {
    width: 100%;
}

.h-captcha {
    margin: 15px 0 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100px;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.h-captcha:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.h-captcha > div {
    width: 100% !important;
    max-width: 304px !important;
    margin: 0 auto !important;
}

/* 모바일에서 hCaptcha 위젯 크기 조정 */
@media (max-width: 480px) {
    .h-captcha > div {
        width: 100% !important;
        max-width: 220px !important;
        transform: scale(0.75) !important;
        transform-origin: center !important;
        margin: 0 auto !important;
        display: flex !important;
        justify-content: center !important;
    }
}

/* Button styles */
button, .btn-verify, .btn-join {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Noto Sans KR', sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(167, 139, 250, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.btn-join {
    background: linear-gradient(135deg, #5865f2, #3b49df);
    font-size: 18px;
    font-weight: 700;
    padding: 20px 36px;
    border-radius: 18px;
    box-shadow:
        0 10px 40px rgba(88, 101, 242, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

button::before, .btn-verify::before, .btn-join::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.6s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover, .btn-verify:hover, .btn-join:hover {
    transform: translateY(-3px);
    box-shadow:
        0 15px 40px rgba(167, 139, 250, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.btn-join:hover {
    box-shadow:
        0 20px 50px rgba(88, 101, 242, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

button:hover::before, .btn-verify:hover::before, .btn-join:hover::before {
    left: 100%;
}

button:active, .btn-verify:active, .btn-join:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

/* Enhanced responsive design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container, .server-invite-container {
        max-width: 100%;
        padding: 30px 25px;
        border-radius: 20px;
        margin: 0 auto;
    }

    .status-icon {
        width: 80px;
        height: 80px;
        font-size: 36px;
        margin-bottom: 20px;
    }

    .server-image {
        width: 110px;
        height: 110px;
        margin-bottom: 20px;
    }

    .status-title {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .server-title {
        font-size: 28px;
        margin-bottom: 18px;
    }

    .status-message {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .status-submessage {
        font-size: 14px;
    }

    .progress-container {
        margin: 15px 0 25px 0;
        padding: 0 10px;
    }

    .progress-bar {
        height: 10px;
    }

    .member-info {
        flex-direction: row;
        gap: 15px;
        margin-bottom: 25px;
        justify-content: center;
    }

    .member-info span {
        justify-content: center;
        padding: 10px 16px;
        font-size: 15px;
        gap: 8px;
    }

    .status-circle {
        width: 10px;
        height: 10px;
    }

    .h-captcha {
        margin: 12px auto;
        padding: 7px;
        border-radius: 10px;
        max-width: 100%;
        min-height: 90px;
        width: 100%;
        box-sizing: border-box;
    }

    button, .btn-verify, .btn-join {
        padding: 14px 24px;
        font-size: 15px;
        border-radius: 14px;
        margin-top: 6px;
    }

    .btn-join {
        padding: 16px 28px;
        font-size: 16px;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .container, .server-invite-container {
        padding: 25px 20px;
        border-radius: 18px;
    }

    .status-icon {
        width: 70px;
        height: 70px;
        font-size: 32px;
        margin-bottom: 18px;
    }

    .server-image {
        width: 100px;
        height: 100px;
        margin-bottom: 18px;
    }

    .status-title, .server-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .member-info span {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        max-width: 45%;
    }

    .h-captcha {
        padding: 5px;
        margin: 10px 0;
        max-width: 100%;
        min-height: 80px;
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
    }

    button, .btn-verify, .btn-join {
        padding: 12px 20px;
        font-size: 14px;
        margin-top: 5px;
    }

    .btn-join {
        padding: 14px 24px;
        font-size: 15px;
    }
}