:root {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.15);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.app-container {
    width: 100%;
    max-width: 900px;
}

/* Przycisk powrotu */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    transition: all 0.2s ease-in-out;
    width: fit-content;
}

.back-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    box-shadow: 0 0 15px var(--accent-glow);
}

.back-btn i { transition: transform 0.2s; }
.back-btn:hover i { transform: translateX(-3px); }

.app-header h2 {
    margin: 5px 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header h2 i { color: var(--accent); }
.app-header p { color: var(--text-secondary); font-size: 14px; margin-bottom: 30px; }

/* Układ główny dwukolumnowy */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

@media (max-width: 768px) {
    .main-layout { grid-template-columns: 1fr; }
}

.control-panel, .preview-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.control-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-card label i { color: var(--accent); margin-right: 5px; }

/* Input tekstowy */
input[type="url"] {
    width: 100%;
    box-sizing: border-box;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: white;
    font-size: 14px;
    transition: all 0.2s;
}

input[type="url"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Grupa Custom Radio */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-label { cursor: pointer; }
.radio-label input { display: none; }

.radio-custom {
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.radio-custom i { font-size: 18px; color: var(--text-secondary); }
.radio-custom span { font-size: 14px; font-weight: 600; color: var(--text-main); }
.radio-custom small { font-size: 11px; color: var(--text-secondary); }

.radio-label input:checked + .radio-custom {
    border-color: var(--accent);
    background: rgba(56, 189, 248, 0.03);
    box-shadow: 0 0 10px var(--accent-glow);
}

.radio-label input:checked + .radio-custom i { color: var(--accent); }

/* Przyciski akcji */
.action-btn, .secondary-btn {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.action-btn {
    background: var(--accent);
    color: #0f172a;
    border: none;
}

.action-btn:hover {
    background: #7dd3fc;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.secondary-btn {
    background: #0f172a;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

/* Viewport Kodu QR */
.qr-viewport {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#qr-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

#qr-placeholder i { font-size: 50px; margin-bottom: 15px; opacity: 0.3; }
#qr-placeholder p { font-size: 13px; margin: 0; }

#qr-image {
    width: 75%;
    height: 75%;
    object-fit: contain;
    border-radius: 8px;
    border: 8px solid white; /* Klasyczna biała ramka dla łatwego skanowania */
}

/* Spinner Ładowania */
.spinner { font-size: 30px; color: var(--accent); }

/* Box Informacyjny */
.info-box {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    margin-bottom: 15px;
    word-break: break-all;
}

.info-label { display: block; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600;}
.info-value { color: var(--accent); font-family: monospace; }

.hidden { display: none !important; }