body, html {
    margin: 0;
    display: flex;
    flex-direction: column;
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    background-color: var(--bg-light);
    color: var(--text-primary);
}

h2 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-xl);
}

p {
    max-width: 500px;
    margin-bottom: var(--spacing-xl);
    line-height: var(--line-height-relaxed);
}

button {
    padding: var(--spacing-lg) var(--spacing-3xl);
    border: 2px dotted var(--text-primary);
    cursor: pointer;
    background: transparent;
    transition: var(--transition-fast);
    font-family: inherit;
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

button:hover {
    background: var(--text-primary);
    color: var(--color-white);
}

#setup-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 600px;
}

#ascii-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
    transform: scale(0.8);
    transform-origin: center;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-md);
    width: 100%;
    min-height: 100vh;
    box-sizing: border-box;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-bottom: 2px solid #ddd;
    color: #888;
    transition: all 0.3s ease;
}

.progress-step.active {
    border-bottom-color: #222;
    color: #222;
    font-weight: bold;
}

.progress-step.completed {
    border-bottom-color: #2ecc40;
    color: #2ecc40;
}

.setup-section {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
}

.setup-section.active {
    display: flex;
}

.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin: 20px 0;
}

.form-section {
    width: 100%;
}

.printers-list {
    width: 100%;
    margin: 15px 0;
}

.printer-item {
    background-color: #f8f8f8;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    border-left: 4px solid #2ecc40;
}

.printer-item h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

.printer-item p {
    margin: 5px 0;
    color: #666;
}

.printer-url {
    font-family: 'Nanum Gothic Coding', monospace;
    font-size: 0.9em;
}

.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 10px;
}

.status-badge.connected {
    background-color: #e6f9ed;
    color: #2ecc40;
}

.status-badge.disconnected {
    background-color: #ffeaea;
    color: #ff4136;
}

#connection-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    background-color: #f8f8f8;
}

#connection-status .success {
    color: #2ecc40;
    font-weight: bold;
}

#connection-status .error {
    color: #ff4136;
    font-weight: bold;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    width: 100%;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #222;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-group {
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 2px dotted #222;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px dotted #222;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.form-group select:focus {
    outline: none;
    border-color: #444;
}

.input-with-prefix {
    display: flex;
    border: 2px dotted #222;
    overflow: hidden;
}

.input-prefix {
    background: #f0f0f0;
    padding: 10px;
    border-right: 1px solid #222;
    font-family: inherit;
    font-size: 1rem;
    color: #666;
    user-select: none;
    white-space: nowrap;
}

.input-suffix {
    background: #f0f0f0;
    padding: 10px;
    border-left: 1px solid #222;
    font-family: inherit;
    font-size: 1rem;
    color: #666;
    user-select: none;
    white-space: nowrap;
}

.input-with-prefix input {
    border: none;
    flex: 1;
    padding: 10px;
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.button-group {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-lg);
}

.setup-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border: 2px dotted var(--border-primary);
    cursor: pointer;
    background: transparent;
    transition: background var(--transition-fast), color var(--transition-fast);
    font-family: inherit;
    font-size: var(--font-size-base);
    width: 100%;
}

.setup-btn:hover {
    background: var(--text-primary);
    color: var(--text-inverted);
}

.setup-btn.primary {
    background: var(--text-primary);
    color: var(--text-inverted);
}

.setup-btn.primary:hover {
    background: #444;
}

.setup-summary {
    width: 100%;
    border: 2px dotted var(--border-primary);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.summary-item {
    margin-bottom: var(--spacing-sm);
}

.status-configured {
    color: var(--success-color);
}

.network-option {
    text-align: left;
    padding: var(--spacing-lg);
    height: auto;
    border: 2px dotted var(--border-tertiary);
    transition: all var(--transition-normal);
}

.network-option:hover {
    border-color: var(--border-primary);
    background: var(--background-accent);
}

.network-option.selected {
    border-color: var(--border-primary);
    background: var(--text-primary);
    color: var(--text-inverted);
}

.option-title {
    font-weight: bold;
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-sm);
}

.option-description {
    font-size: var(--font-size-sm);
    line-height: 1.4;
    opacity: 0.8;
}

.network-option.selected .option-description {
    opacity: 0.9;
}

.tunnel-option {
    position: relative;
    text-align: left;
    padding: var(--spacing-lg);
    height: auto;
    border: 2px dotted var(--border-tertiary);
    transition: all var(--transition-normal);
}

.tunnel-option:hover {
    border-color: var(--border-primary);
    background: var(--background-accent);
}

.tunnel-option.selected {
    border-color: var(--border-primary);
    background: var(--text-primary);
    color: var(--text-inverted);
}

.tunnel-option.selected .option-description {
    opacity: 0.9;
}

.form-section small {
    display: block;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
}

.form-section small a {
    color: #222;
    text-decoration: underline;
}

.loading-container, .success-container, .error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-icon, .error-icon {
    font-size: 50px;
    margin-bottom: 20px;
}

.success-icon {
    color: #2ecc40;
}

.error-icon {
    color: #ff4136;
}

.tunnel-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    width: 100%;
    max-width: 400px;
    text-align: left;
}

.tunnel-info p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.tunnel-info strong {
    color: #333;
}

.error-details {
    background: #ffe6e6;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    color: #cc0000;
    font-family: monospace;
    font-size: 14px;
    width: 100%;
    max-width: 400px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    user-select: none;
}

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

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.checkbox-container:hover .checkmark {
    border-color: #222;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #222;
    border-color: #222;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.info-section {
    width: 100%;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.info-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1em;
}

.external-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #0066cc;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px 0;
    transition: background-color 0.3s ease;
}

.external-link:hover {
    background-color: #0052a3;
}

.os-option {
    background-color: #f5f5f5;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.os-option:hover {
    border-color: #0066cc;
    background-color: #f0f7ff;
}

.os-option.selected {
    border-color: #0066cc;
    background-color: #e6f3ff;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.token-display label {
    font-weight: bold;
    color: #333;
    min-width: 100px;
}

.token-value {
    flex: 1;
    font-family: monospace;
    background-color: white;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    word-break: break-all;
    font-size: 0.9em;
}

.copy-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background-color: #f0f0f0;
}

.command-display {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.command-display label {
    font-weight: bold;
    color: #333;
    min-width: 60px;
}

.command-value {
    flex: 1;
    font-family: monospace;
    background-color: white;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    word-break: break-all;
    font-size: 0.9em;
}

.copy-btn:hover {
    background-color: #f0f0f0;
}

.note {
    font-style: italic;
    color: #666;
    margin-top: 15px;
    padding: 10px;
    background-color: #fff9e6;
    border-left: 4px solid #ffa500;
    border-radius: 3px;
}

.warp-enrollment-section {
    border: 2px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
}

.warp-enrollment-section h4 {
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

#warp-qr-code canvas {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
}

.warp-device-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.warp-device-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    text-decoration: none;
    color: white;
}

.recommended-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border: 2px dotted white;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: white;
    }
    50% {
        border-color: rgba(255, 255, 255, 0.6);
    }
}

.tunnel-option.selected .recommended-badge {
    background: rgba(46, 204, 64, 0.9);
    border-color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 600px) {
    button {
        padding: var(--spacing-sm) var(--spacing-xl);
    }
}

@media (max-width: 874px) {
    #ascii-title {
        transform: scale(0.4);
    }
}