:root {
    /* Color Palette */
    --background: 240 10% 4%;
    --foreground: 0 0% 98%;

    --card: 240 10% 6%;
    --card-foreground: 0 0% 98%;

    --popover: 240 10% 4%;
    --popover-foreground: 0 0% 98%;

    --primary: 151 65% 54%;
    /* Vibrant Green */
    --primary-foreground: 144 70% 5%;

    --secondary: 240 4% 16%;
    --secondary-foreground: 0 0% 98%;

    --muted: 240 4% 16%;
    --muted-foreground: 240 5% 65%;

    --accent: 262 83% 58%;
    /* Purple accent */
    --accent-foreground: 0 0% 98%;

    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 98%;

    --border: 240 4% 16%;
    --input: 240 4% 16%;
    --ring: 151 65% 54%;

    --radius: 0.75rem;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(151 65% 54%), hsl(140 70% 40%));
    --gradient-dark: linear-gradient(180deg, hsl(240 10% 4%), hsl(240 10% 8%));
    --glass-bg: rgba(20, 20, 25, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Effects */
.bg-gradient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 15% 50%, rgba(151, 245, 188, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
}

.layout {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: hsl(var(--foreground));
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
}

.card-title {
    font-size: 2rem;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.card-description {
    color: hsl(var(--muted-foreground));
    font-size: 0.95rem;
}

.card-content {
    padding: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-left: 0.25rem;
}

.currency-input-group {
    display: flex;
    gap: 0.75rem;
}

input,
select {
    background-color: hsl(var(--muted) / 0.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1rem;
    width: 100%;
    transition: all 0.2s ease;
    outline: none;
}

input:focus,
select:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
    background-color: hsl(var(--muted));
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select option {
    background-color: hsl(var(--card));
    color: hsl(var(--foreground));
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(16, 185, 129, 0.4);
    filter: brightness(110%);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: hsl(var(--foreground));
}

.btn-outline:hover {
    background: hsl(var(--muted));
    border-color: hsl(var(--primary) / 0.5);
}

/* Swap Button */
#swapButton {
    background: hsl(var(--muted));
    border: 1px solid var(--border);
    color: hsl(var(--foreground));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#swapButton:hover {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
    transform: rotate(180deg);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background-color: hsl(var(--destructive) / 0.15);
    border: 1px solid hsl(var(--destructive) / 0.2);
    color: #fca5a5;
}

.alert-info {
    background-color: hsl(var(--secondary));
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
}

.alert-warning {
    background-color: hsl(35 90% 50% / 0.15);
    border: 1px solid hsl(35 90% 50% / 0.2);
    color: #fdba74;
}

/* Stepper */
.step-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.step-content.active {
    display: block;
}

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

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

/* Button Group */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(var(--border) / 0.5);
    flex-direction: row;
    /* Ensure horizontal layout */
    width: 100%;
}

.button-group .btn {
    min-width: 120px;
    margin: 0;
    /* Remove default margins */
}

.stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    background: hsl(var(--muted));
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    background: hsl(var(--background));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 80px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsl(var(--muted));
    border: 2px solid hsl(var(--background));
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 0 0 4px hsl(var(--primary) / 0.2);
}

.step.completed .step-number {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.step-label {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
}

.step.active .step-label {
    color: hsl(var(--primary));
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.font-bold {
    font-weight: 700;
}

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-muted {
    color: hsl(var(--muted-foreground));
}

/* Validation */
input.error,
select.error {
    border-color: hsl(var(--destructive));
    box-shadow: 0 0 0 2px hsl(var(--destructive) / 0.2);
}

.input-message-error {
    color: hsl(var(--destructive));
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
}

input.error+.input-message-error,
select.error+.input-message-error {
    display: block;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

@media (max-width: 640px) {
    .card {
        padding: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }

    .glass-card {
        border-radius: 0;
        border: none;
        height: 100vh;
        width: 100vw;
        max-width: none;
        overflow-y: auto;
    }

    .layout {
        padding: 0;
    }

    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}