:root {
    --primary: #3157D5;
    --primary-dark: #1e3a8a;
    --primary-light: #eef2ff;
    --primary-subtle: rgba(49, 87, 213, 0.08);
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --purple: #7c3aed;
    --teal: #0d9488;
    --dark: #0f172a;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-card: 0 12px 36px -4px rgba(15, 23, 42, 0.08);
}

/* ─── Hero Section ─── */
.encoder-hero {
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 55%, #3157D5 100%);
    color: #ffffff;
    padding: 60px 0 50px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.encoder-hero::after {
    content: "";
    position: absolute;
    top: -120px;
    right: -60px;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.3) 0%, transparent 70%);
    pointer-events: none;
}
.encoder-hero .container {
    position: relative;
    z-index: 2;
}
.encoder-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.4rem 1.15rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #e0e7ff;
    margin-bottom: 1.25rem;
    backdrop-filter: blur(10px);
}
.encoder-hero h1 {
    font-size: clamp(2rem, 3.8vw, 2.9rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.85rem;
    letter-spacing: -0.025em;
}
.encoder-hero p.lead {
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.12rem;
    max-width: 680px;
    margin: 0 auto 1.6rem;
    line-height: 1.6;
}
.encoder-hero-actions {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}
.encoder-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.encoder-hero-btn-white {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.encoder-hero-btn-white:hover {
    background: #f8fafc;
    color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
}
.encoder-hero-btn-glass {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
}
.encoder-hero-btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ─── Main Wrapper & Card ─── */
.encoder-section {
    padding: 45px 0 80px;
    background: #f8fafc;
}
.encoder-main-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-card);
    padding: 40px 45px;
    margin-bottom: 40px;
}

/* ─── Method Segmented Tabs ─── */
.method-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
    margin-bottom: 2.25rem;
}
.method-card-btn {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.45rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    box-shadow: var(--shadow-subtle);
}
.method-card-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -2px rgba(15, 23, 42, 0.08);
}
.method-card-btn.active {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 10px 28px -4px rgba(49, 87, 213, 0.18);
    transform: translateY(-3px);
}
.method-card-btn.active::after {
    content: "";
    position: absolute;
    top: -2px;
    left: 20%;
    right: 20%;
    height: 3.5px;
    background: var(--primary);
    border-radius: 99px;
}
.method-btn-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.method-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.method-card-btn.method-1 .method-icon-wrap { background: #dcfce7; color: #166534; }
.method-card-btn.method-2 .method-icon-wrap { background: #fef3c7; color: #b45309; }
.method-card-btn.method-3 .method-icon-wrap { background: #ede9fe; color: #6d28d9; }

.method-btn-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.method-btn-desc {
    font-size: 0.86rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}
.method-badges-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}

/* Badges */
.enc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
    display: inline-block;
}
.enc-badge-green  { background: #dcfce7; color: #15803d; }
.enc-badge-amber  { background: #fef3c7; color: #b45309; }
.enc-badge-purple { background: #ede9fe; color: #6d28d9; }
.enc-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.enc-badge-teal   { background: #ccfbf1; color: #0f766e; }

/* ─── Form Step Cards ─── */
.enc-form-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
    transition: all 0.2s ease;
}
.enc-form-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.enc-step-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.35rem;
    padding-bottom: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
}
.enc-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #3157D5);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(49, 87, 213, 0.25);
}
.enc-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}
.enc-step-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.2rem 0 0;
}

/* ─── Modern Form Labels & Controls ─── */
.form-label-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.6rem;
}
.form-label-custom i {
    font-size: 0.95rem;
}

/* Standardized Custom Form Control */
.form-control-custom {
    display: block;
    width: 100%;
    padding: 0.72rem 1rem;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
    color: #0f172a;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-control-custom:focus {
    color: #0f172a;
    background-color: #ffffff;
    border-color: #3157D5;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.14);
}

/* Select Dropdown Styling */
select.form-control-custom {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%233157D5' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* License Input & Check Button */
.license-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}
.license-input-field {
    flex-grow: 1;
    font-family: "Consolas", "SFMono-Regular", "Liberation Mono", Menlo, monospace;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.75rem 1.1rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #f8fafc;
    color: #0f172a;
    transition: all 0.2s ease;
}
.license-input-field:focus {
    outline: none;
    border-color: #3157D5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.14);
}

.btn-verify-chip {
    background: #eef2ff;
    color: #3157D5;
    border: 1.5px solid rgba(49, 87, 213, 0.35);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.4rem;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.22s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-verify-chip:hover {
    background: #3157D5;
    color: #ffffff;
    border-color: #3157D5;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(49, 87, 213, 0.25);
}

.license-status-wrap {
    margin-top: 0.85rem;
    font-size: 0.88rem;
    display: none;
}
.license-status-wrap.show { display: block; }
.license-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.status-valid   { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.status-invalid { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.status-checking { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

/* Color Controls */
.color-palette-wrap {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}
.color-preview-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.color-preview-box:hover {
    transform: scale(1.06);
    border-color: #cbd5e1;
}
.color-input-native {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 65px;
    height: 65px;
    opacity: 0;
    cursor: pointer;
}
.preset-swatches {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.color-swatch {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2.5px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.color-swatch:hover {
    transform: scale(1.18);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    z-index: 2;
}
.color-swatch.active {
    border-color: #0f172a;
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}

/* Switch Controls */
.enc-switch-item {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.95rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    cursor: pointer;
    transition: all 0.22s ease;
    height: 100%;
}
.enc-switch-item:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.enc-switch-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.form-check-input-custom {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #3157D5;
    border-radius: 6px;
    flex-shrink: 0;
}

/* ─── Turnstile Card ─── */
.enc-turnstile-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1.5px solid #bfdbfe;
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    margin-bottom: 1.75rem;
    text-align: center;
}
.enc-turnstile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 0.85rem;
}
.turnstile-widget-wrap {
    display: flex;
    justify-content: center;
    margin: 0.5rem auto;
    min-height: 65px;
}
.turnstile-alert-msg {
    color: #dc2626;
    font-size: 0.86rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: none;
}

/* ─── Action Button ─── */
.btn-generate-main {
    background: linear-gradient(135deg, #1e3a8a 0%, #3157D5 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 2.75rem;
    font-size: 1.08rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(49, 87, 213, 0.28);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}
.btn-generate-main:hover {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(49, 87, 213, 0.38);
    color: #ffffff;
}

/* ─── Code Output Terminal ─── */
.code-output-card {
    background: #0f172a;
    border-radius: var(--radius-lg);
    border: 1px solid #1e293b;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.3);
    margin-top: 2.75rem;
    overflow: hidden;
    display: none;
}
.code-terminal-header {
    background: #1e293b;
    padding: 0.85rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.terminal-dots {
    display: flex;
    gap: 7px;
}
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot-red    { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green  { background: #10b981; }

.terminal-tabs {
    display: flex;
    gap: 0.5rem;
}
.terminal-tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}
.terminal-tab-btn.active {
    background: #3157D5;
    border-color: #3157D5;
    color: #ffffff;
}

.code-terminal-body {
    padding: 1.4rem 1.6rem;
    position: relative;
}
.code-pre-block {
    margin: 0;
    background: transparent !important;
    padding: 0;
    font-family: "Consolas", "Fira Code", "SFMono-Regular", monospace;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 480px;
    overflow-y: auto;
}
.btn-copy-code {
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.2rem;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
.btn-copy-code:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.code-terminal-footer {
    background: #131d33;
    padding: 0.75rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ─── Comparison Table ─── */
.enc-table-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    border: 1px solid #e2e8f0;
    padding: 2.25rem;
    margin-top: 2.75rem;
    box-shadow: var(--shadow-card);
}
.enc-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.enc-comp-table th, .enc-comp-table td {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
}
.enc-comp-table th:first-child, .enc-comp-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #1e293b;
}
.enc-comp-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

@media (max-width: 991px) {
    .method-nav-grid { grid-template-columns: 1fr; }
    .encoder-main-card { padding: 25px 20px; }
    .license-input-group { flex-direction: column; align-items: stretch; }
    .btn-verify-chip { width: 100%; justify-content: center; }
}
