html {
    color-scheme: dark;
}

:root {
    --primary: #5112f4;
    --primary-light: #7a46f9;
    --background: #0f1013;
    --card-bg: rgba(25, 26, 30, 0.7);
    --text-main: #e0e0e3;
    --text-dim: #94949b;
    --accent: #00f5d4;
    --error: #ff5f5f;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background: linear-gradient(135deg, #050609 0%, #0a1128 50%, #050609 100%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animations */
.background-circles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 15s infinite alternate ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: #000d3e;
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 500px;
    height: 500px;
    background: #000000;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1.0); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    z-index: 1;
}

header {
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.secondary-logo {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.6;
}

.logo-group {
    display: flex;
    flex-direction: column;
}

.by-line {
    display: none;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dim);
    margin-left: 3.3rem;
    margin-top: -0.5rem;
    opacity: 0.8;
    font-family: 'Outfit', sans-serif;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.8rem;
}

.logo .icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    font-weight: 300;
}

/* Glass Card */
.glass {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 3rem;
}

#helpBtn {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 10;
}



/* Form Styles */
.row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.row > div {
    flex: 1;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.help-circle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 0px solid var(--glass-border);
    color: var(--text-dim);
    font-size: 23px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.help-circle-btn:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.1);
    border-color: var(--primary-light);
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

input, select {
    background: #15161a !important;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    color-scheme: dark !important;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' 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 1rem center;
    background-size: 1.25rem;
    cursor: pointer;
}

select option {
    background-color: #1a1b1e !important;
    color: #fff !important;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: #1f2024 !important;
    box-shadow: 0 0 0 4px rgba(81, 18, 244, 0.2);
}

/* Primary Button */
.primary-btn {
    width: 100%;
    margin-top: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(81, 18, 244, 0.3);
}

.primary-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(81, 18, 244, 0.5);
}

.primary-btn:active {
    transform: scale(0.98);
}

/* Loader */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Footer Status Bar */
.status-bar {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-dim);
}

#statusMsg.error {
    color: var(--error);
}

#statusMsg.success {
    color: var(--accent);
}

/* Specialized Layout Groups */
.glass-inset {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.section-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.5px;
}

.label-specs.glass-inset {
    background: rgba(255, 255, 255, 0.05);
}

/* Responsive */
@media (max-width: 500px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0rem;
        margin-bottom: 1em;
    }
    .secondary-logo {
        display: none;
    }
    .by-line {
        display: block;
    }
    .row {
        flex-direction: column;
        gap: 0;
    }
    .app-container {
        padding: 1rem;
    }
    .glass {
        padding: 2rem;
    }
}


/* Interactive Components */
.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-light);
    transform: translateY(-2px);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: none; /* Controlled by JS */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    padding: 2.5rem;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--error);
}

.instruction-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.help-item h4 {
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.help-item p {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 0.95rem;
}

.help-item strong {
    color: var(--text-main);
}
