:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --background: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.8);
    --border-color: rgba(148, 163, 184, 0.2);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --input-bg: rgba(30, 41, 59, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

.background-gradient {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    animation: gradient-shift 15s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradient-shift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(10%, 10%) rotate(5deg);
    }
}

.main-layout {
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    gap: 2rem;
    position: relative;
    z-index: 1;
    align-items: flex-start;
}

.left-panel,
.middle-panel,
.right-panel {
    flex: 1;
    min-width: 0;
}

.left-panel {
    max-width: 300px;
}

@media (max-width: 1200px) {
    .left-panel {
        display: none;
    }
}

.middle-panel {
    max-width: 600px;
    width: 100%;
}

.right-panel {
    max-width: 500px;
    width: 100%;
    position: sticky;
    top: 2rem;
}

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
        padding: 0 1rem;
    }

    .middle-panel,
    .right-panel {
        max-width: 600px;
        position: static;
    }
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    animation: fade-in-down 0.6s ease;
}

@keyframes fade-in-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    animation: pulse-glow 2s ease infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.8));
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 0.6s ease 0.2s backwards;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group:last-of-type {
    margin-bottom: 1.5rem;
}

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.icon {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

input[type="text"] {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.7);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-card {
    position: relative;
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.radio-card:hover {
    border-color: var(--primary-light);
    background: rgba(30, 41, 59, 0.7);
    transform: translateX(4px);
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-card input[type="radio"]:checked~.radio-content {
    color: var(--text-primary);
}

.radio-card input[type="radio"]:checked~.radio-indicator {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.radio-card input[type="radio"]:checked~.radio-indicator::after {
    opacity: 1;
    transform: scale(1);
}

.radio-card input[type="radio"]:checked+.radio-content+.radio-indicator {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

label.radio-card input[type="radio"]:checked {
    border-color: var(--primary-color);
}

label.radio-card:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.radio-content {
    flex: 1;
    color: var(--text-secondary);
    transition: var(--transition);
}

.radio-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.radio-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.radio-indicator {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
}

.radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
}

.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(99, 102, 241, 0.5);
}

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

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

.btn-secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-top: 1rem;
}

.btn-secondary:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Billing Button */
.btn-billing {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.btn-billing:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
}

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

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

/* Billing Status */
.billing-status {
    margin-top: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.billing-status.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.billing-status.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.billing-status.loading {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

input[type="email"] {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

input[type="email"]:focus {
    border-color: var(--primary-color);
    background: rgba(30, 41, 59, 0.7);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

input[type="email"]::placeholder {
    color: var(--text-muted);
}

.result-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 0.6s ease;
}

.result-placeholder {
    background: rgba(30, 41, 59, 0.3);
    border: 2px dashed var(--border-color);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.placeholder-content svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder-content p {
    font-size: 1rem;
    font-weight: 500;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.result-icon {
    width: 28px;
    height: 28px;
    color: var(--success-color);
}

.result-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.result-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--primary-light);
    font-size: 0.95rem;
    word-break: break-all;
    transition: var(--transition);
    margin-bottom: 1rem;
}

.result-link:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(4px);
}

.link-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 0.75rem;
}

.result-content {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
}

.result-content::-webkit-scrollbar {
    width: 8px;
}

.result-content::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.result-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.error-container {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 25px 50px -12px rgba(239, 68, 68, 0.2);
    animation: fade-in-up 0.6s ease;
}

.error-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.error-icon {
    width: 28px;
    height: 28px;
    color: var(--error-color);
}

.error-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.error-message strong {
    display: block;
    color: var(--error-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.error-message p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    word-break: break-word;
}

.error-suggestions {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.error-suggestions strong {
    display: block;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.error-suggestions ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.error-suggestions li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.error-suggestions li:last-child {
    margin-bottom: 0;
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    transform: translateY(150%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
}

.toast.success {
    border-color: var(--success-color);
}

.toast.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Help Button */
.help-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 15px 35px -5px rgba(99, 102, 241, 0.7);
}

/* Help Panel - Slides from right */
.help-modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.help-modal.show {
    display: block;
}

.help-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.help-modal.show::before {
    opacity: 1;
    pointer-events: auto;
}

.help-modal-content {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 450px;
    max-width: 90vw;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.help-modal.show .help-modal-content {
    transform: translateX(0);
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.help-modal-header h2 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}

.close-help {
    background: none;
    border: none;
    font-size: 2.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.close-help:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.help-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.help-modal-body::-webkit-scrollbar {
    width: 8px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    font-size: 1.1rem;
    color: var(--primary-light);
    margin-bottom: 0.75rem;
}

.help-section ol,
.help-section ul {
    color: var(--text-secondary);
    line-height: 1.8;
    padding-left: 1.5rem;
}

.help-section li {
    margin-bottom: 0.75rem;
}

.help-section li ul {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.help-section a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.help-section a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.help-section code,
.help-section kbd {
    background: var(--input-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-light);
    border: 1px solid var(--border-color);
}

.help-note {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.help-note strong {
    color: var(--primary-light);
}

.help-faq {
    list-style: none;
    padding-left: 0;
}

.help-faq li {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.help-faq strong {
    color: var(--primary-light);
    display: block;
    margin-bottom: 0.5rem;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-primary:disabled .btn-icon {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .help-btn {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .help-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .help-modal-header,
    .help-modal-body {
        padding: 1.5rem;
    }

    .help-modal-header h2 {
        font-size: 1.4rem;
    }
}

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

    h1 {
        font-size: 2rem;
    }

    .card,
    .result-container {
        padding: 1.5rem;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}