/* Generator konta pocztowego — style dopasowane do UI Bitrix24 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13px;
    color: #333;
    background: #f5f5f5;
    padding: 12px;
}

.generator-widget {
    max-width: 420px;
}

.widget-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

/* ─── Formularz ─────────────────────────────── */

.field-group { margin-bottom: 12px; }

.field-group label {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-bottom: 4px;
}

.input-domain-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.prefix-input {
    flex: 1;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 13px;
    font-family: "Courier New", monospace;
    outline: none;
    transition: border-color .15s;
}

.prefix-input:focus { border-color: #4a90d9; }
.prefix-input:disabled { background: #f7fafc; color: #a0aec0; }

.domain-suffix {
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #718096;
    white-space: nowrap;
}

.source-hint {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 4px;
}

.field-error {
    font-size: 11px;
    color: #e53e3e;
    margin-top: 4px;
}

/* ─── Przyciski ─────────────────────────────── */

.btn-primary, .btn-secondary, .btn-copy {
    display: inline-block;
    height: 32px;
    padding: 0 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
    width: 100%;
    margin-top: 4px;
}
.btn-primary:hover:not(:disabled) { background: #3a7bc8; }
.btn-primary:disabled { background: #a0c4e8; cursor: not-allowed; }

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}
.btn-secondary:hover { background: #cbd5e0; }

.btn-copy {
    background: #edf2f7;
    color: #4a5568;
    height: 26px;
    font-size: 11px;
    padding: 0 10px;
    margin-top: 4px;
}
.btn-copy:hover { background: #e2e8f0; }

/* ─── Spinner ────────────────────────────────── */

#view-loading {
    text-align: center;
    padding: 24px 0;
    color: #718096;
}

.spinner {
    width: 28px;
    height: 28px;
    margin: 0 auto 12px;
    border: 3px solid #e2e8f0;
    border-top-color: #4a90d9;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

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

/* ─── Wyniki ─────────────────────────────────── */

.result-box {
    border-radius: 6px;
    padding: 14px;
    margin-top: 4px;
}

.result-box--ok    { background: #f0fff4; border: 1px solid #9ae6b4; }
.result-box--error { background: #fff5f5; border: 1px solid #feb2b2; }

.result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
    color: #4a5568;
}

.result-value {
    font-family: "Courier New", monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 4px;
}

.result-value--password { color: #744210; }

/* ─── Modal ──────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    max-width: 320px;
    width: 90%;
    text-align: center;
}

.modal p { margin-bottom: 8px; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

/* ─── Utility ────────────────────────────────── */

.hidden { display: none !important; }
