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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0a1a;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.vortex-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: floatOrb 8s ease-in-out infinite;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: #25D366;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.glow-orb-2 {
    width: 300px;
    height: 300px;
    background: #1a8a4a;
    bottom: -50px;
    left: -50px;
    animation-delay: -3s;
}

.glow-orb-3 {
    width: 200px;
    height: 200px;
    background: #4ade80;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -6s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.container {
    position: relative;
    z-index: 1;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 80px rgba(37, 211, 102, 0.05);
    border: 1px solid rgba(37, 211, 102, 0.1);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

header {
    margin-bottom: 30px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    flex-shrink: 0;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(37, 211, 102, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(37, 211, 102, 0.6));
    }
}

header h1 {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #25D366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vortex-text {
    background: linear-gradient(135deg, #25D366, #4ade80);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header .tagline {
    color: #8899aa;
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 400;
    letter-spacing: 0.3px;
}

.status-card {
    background: rgba(30, 42, 74, 0.6);
    border-radius: 12px;
    padding: 12px 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.status-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.status-indicator.connected {
    background: #25D366;
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.5);
    animation: pulseGreen 1.5s ease-in-out infinite;
}

.status-indicator.disconnected {
    background: #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 0 20px rgba(37, 211, 102, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(37, 211, 102, 0.6);
    }
}

.status-text.connected {
    color: #25D366;
}

.status-text.disconnected {
    color: #ff4444;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #8899aa;
}

.server-name {
    color: #25D366;
    font-weight: 600;
}

.server-selector {
    margin-bottom: 20px;
}

.server-selector label {
    display: block;
    color: #8899aa;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 40px 12px 16px;
    background: rgba(30, 42, 74, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.select-wrapper select:hover {
    border-color: rgba(37, 211, 102, 0.3);
}

.select-wrapper select:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.select-wrapper select option {
    background: #16213e;
    color: #fff;
    padding: 10px;
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.select-wrapper select:focus + .select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.link-device-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #25D366, #1da851);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', sans-serif;
}

.link-device-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.link-device-btn:active {
    transform: translateY(0);
}

.btn-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
}

.link-device-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.form-container {
    animation: fadeIn 0.4s ease-in;
}

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

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    color: #8899aa;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(30, 42, 74, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.input-prefix {
    padding: 12px 0 12px 16px;
    color: #8899aa;
    font-weight: 500;
    font-size: 0.95rem;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 8px;
    background: transparent;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.input-wrapper input:focus {
    outline: none;
}

.input-wrapper input::placeholder {
    color: #556;
}

.input-hint {
    display: block;
    color: #556;
    font-size: 0.75rem;
    margin-top: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #25D366;
    flex-shrink: 0;
}

.checkbox-group label {
    color: #8899aa;
    font-size: 0.9rem;
    cursor: pointer;
}

.get-code-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #25D366, #1da851);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
}

.get-code-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.get-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-loader {
    display: none;
    gap: 4px;
}

.btn-loader span {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: bounceDot 1.4s ease-in-out infinite both;
}

.btn-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.btn-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounceDot {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.pairing-code-container {
    animation: fadeIn 0.6s ease-in;
}

.pairing-code-box {
    background: rgba(30, 42, 74, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(37, 211, 102, 0.15);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.code-header label {
    color: #8899aa;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.code-status {
    font-size: 0.75rem;
    color: #fbbf24;
}

.code-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#pairingCodeText {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: #25D366;
    letter-spacing: 1px;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.copy-btn:hover {
    background: rgba(37, 211, 102, 0.25);
    transform: scale(1.05);
}

.code-instructions {
    margin-top: 12px;
    padding: 10px;
    background: rgba(37, 211, 102, 0.05);
    border-radius: 6px;
    border-left: 3px solid #25D366;
}

.code-instructions p {
    font-size: 0.8rem;
    color: #8899aa;
}

footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.developer {
    color: #8899aa;
    font-size: 0.85rem;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8899aa;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: #25D366;
}

.footer-bottom {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #445;
    font-size: 0.75rem;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 10px;
    animation: slideInToast 0.3s ease-out;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(37, 211, 102, 0.2);
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.toast.success {
    border-color: #25D366;
}

.toast.error {
    border-color: #ff4444;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 24px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .status-container {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}
