* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ee5a52;
    --primary-light: #ff8787;
    --accent-color: #4ecdc4;
    --accent-dark: #45b8b0;
    --success-color: #26de81;
    --error-color: #fc5c65;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --background: #f7f9fc;
    --card-bg: #ffffff;
    --border-color: #dfe6e9;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 80px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
}

.circle-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.circle-2 {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation: float 15s ease-in-out infinite reverse;
}

.circle-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    left: 50%;
    animation: float 25s ease-in-out infinite;
}

.container {
    max-width: 650px;
    margin: 0 auto;
    padding: 30px 0;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    color: var(--primary-color);
    position: relative;
    animation: pulse 3s ease-in-out infinite;
}

.logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    z-index: -1;
    opacity: 0;
    animation: glow 3s ease-in-out infinite;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.brand-name {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: -1px;
}

.brand-tagline {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
    padding: 4px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.05rem;
    font-weight: 500;
    max-width: 500px;
    margin: 0 auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.card {
    background: var(--card-bg);
    border-radius: 28px;
    padding: 45px;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.form-group label svg {
    color: var(--primary-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--background);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: var(--card-bg);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236366f1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

.proxy-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    border: 2px solid #bae6fd;
}

.proxy-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

.proxy-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.proxy-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 30px;
}

.proxy-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.proxy-toggle input:checked + .proxy-slider {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
}

.proxy-toggle input:checked + .proxy-slider:before {
    transform: translateX(26px);
}

.proxy-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.proxy-info svg {
    color: var(--accent-color);
    flex-shrink: 0;
}

.proxy-info > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.proxy-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.proxy-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
}

.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-submit:hover::before {
    width: 300px;
    height: 300px;
}

.btn-submit:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.5);
}

.btn-submit:active {
    transform: translateY(-1px) scale(0.98);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-submit svg,
.btn-submit span {
    position: relative;
    z-index: 1;
}

.result-card,
.error-card {
    animation: fadeInUp 0.5s ease-out;
}

.result-header {
    text-align: center;
    margin-bottom: 32px;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 85px;
    background: linear-gradient(135deg, var(--success-color) 0%, #20d77c 100%);
    border-radius: 50%;
    color: white;
    margin-bottom: 20px;
    animation: successBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(38, 222, 129, 0.4);
    position: relative;
}

.success-icon::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: inherit;
    opacity: 0.2;
    animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.result-header h2 {
    color: var(--text-dark);
    font-size: 1.75rem;
    font-weight: 700;
}

.result-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 32px;
}

.result-item {
    padding: 24px;
    background: linear-gradient(135deg, var(--background) 0%, #f1f3f5 100%);
    border-radius: 16px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 107, 107, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-item:hover {
    transform: translateX(8px);
    box-shadow: -8px 8px 20px rgba(0, 0, 0, 0.08);
}

.result-item:hover::before {
    opacity: 1;
}

.result-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-label svg {
    color: var(--primary-color);
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    word-break: break-word;
}

.btn-reset {
    width: 100%;
    padding: 14px;
    background: var(--background);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.error-card {
    text-align: center;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 50%;
    color: var(--error-color);
    margin-bottom: 24px;
    animation: shake 0.5s ease-out;
}

.error-card h3 {
    color: var(--error-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.error-card p {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 1rem;
}

.loader {
    text-align: center;
    padding: 60px 40px;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

.loader p {
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.05rem;
}

footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.footer-brand span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    opacity: 0.9;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes successBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -30px) rotate(120deg);
    }
    66% {
        transform: translate(-20px, 20px) rotate(240deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 0.3;
    }
}

@keyframes gradientMove {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

@keyframes ping {
    75%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@media (max-width: 640px) {
    body {
        padding: 15px;
    }

    .logo-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .logo-text {
        align-items: center;
    }

    .brand-name {
        font-size: 2.2rem;
    }

    .brand-tagline {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .card {
        padding: 30px 24px;
        border-radius: 24px;
    }

    .logo-icon {
        width: 70px;
        height: 70px;
    }

    .result-value {
        font-size: 1.1rem;
    }

    .circle-1 {
        width: 200px;
        height: 200px;
    }

    .circle-2 {
        width: 150px;
        height: 150px;
    }

    .circle-3 {
        width: 100px;
        height: 100px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
